PersonTest.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using MyClasses.PersonClasses;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace MyClassesTest
  9. {
  10. [TestClass]
  11. public class PersonTest : TestBase
  12. {
  13. #region Initialize and Cleanup class Test
  14. [ClassInitialize]
  15. public static void InitializeClass(TestContext tc)
  16. {
  17. }
  18. [ClassCleanup]
  19. public static void CleanUpClass()
  20. {
  21. }
  22. #endregion
  23. [TestMethod]
  24. public void IsNullTest()
  25. {
  26. PersonManager mgr = new PersonManager();
  27. Person per;
  28. per = mgr.CreatePerson("", "Sheriff", true);
  29. Assert.IsNull(per);
  30. }
  31. [TestMethod]
  32. public void IsIntanceOfTypeTest()
  33. {
  34. PersonManager mgr = new PersonManager();
  35. Person per;
  36. per = mgr.CreatePerson("Paul", "Sheriff", true);
  37. Assert.IsInstanceOfType(per, typeof(Supervisor));
  38. }
  39. }
  40. }