简体   繁体   中英

How to share unit test between other projects in the solution?

My sincere apologies, if am duplicating the question here. I have set of tests that need to shared among 3 other projects and my application is web paged

I am considering google as an example:

  • Shared Project Tests: Login to google
  • Google Drive Project: Add, Upload Tests
  • Google Mail Project - Compose, Read, Unread Tests
  • Google Maps Project - Search Location Tests

Output:

All the projects should have google login test added part of the test suite.

Thanks for your answers

  1. Right click the solution you wish to add the existing test to
  2. Click Add then Existing Item in the popup menu
  3. Find the existing file
  4. Single-click it to select it
  5. Click the DropDown icon next to the Add button
  6. Select "Add as link"

All the projects should have google login test added part of the test suite.

This is incorrect. There should be only one Login module for which there is tests. All other projects should have no login logic whatsoever. They should either assume user is already logged in or only receive relevant permissions.

Simply said : Duplicate tests signalize duplicate logic. And duplicate logic is A Bad Thing (tm).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM