DistinctCharsTest.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using DistinctChar;
  2. namespace DistinctCharsTest
  3. {
  4. [TestClass]
  5. public class DistinctCharsTest
  6. {
  7. [TestMethod]
  8. public void SetStr1_writeAbcd_Str1ContainAbcs()
  9. {
  10. DistinctChars obj = new DistinctChars();
  11. obj.Str1 = "abcd";
  12. string rezult = "abcd";
  13. Assert.AreEqual(obj.Str1, rezult);
  14. }
  15. [TestMethod]
  16. public void SetStr2_writeAbcd_Str2IsNotBcfd()
  17. {
  18. DistinctChars obj = new DistinctChars();
  19. obj.Str2 = "abcd";
  20. string rezult = "bcfd";
  21. Assert.AreNotEqual(obj.Str1, rezult);
  22. }
  23. [TestMethod]
  24. public void DistinctChars_SetAbcdeAndBcfr_GetAbcdef()
  25. {
  26. DistinctChars obj = new DistinctChars();
  27. obj.Str1 = "abcde";
  28. obj.Str2 = "bcfr";
  29. string rezult = "abcdef";
  30. Assert.AreEqual(obj.GetDistinctStr(), rezult);
  31. }
  32. [TestMethod]
  33. public void DistinctChars_SetAbcdeAndBcfr_GetNotAbcdebcfr()
  34. {
  35. DistinctChars obj = new DistinctChars();
  36. obj.Str1 = "abcde";
  37. obj.Str2 = "bcfr";
  38. string rezult = "abcdebcfr";
  39. Assert.AreNotEqual(obj.GetDistinctStr(), rezult);
  40. }
  41. }
  42. }