public void TestVerifyNotExists() { var ExpectedResult = new ValidateResult(); CardServices _Repo = new CardServices(); IEnumerator enumerator = KeyTestData.GetEnumerator(); while (enumerator.MoveNext()) { object obj = enumerator.Current; CardData4Test_key keydef = new CardData4Test_key(); CardData4Test_key key = (obj != null) ? ((CardData4Test_key)obj) : keydef; if (key.TestScenario == ScenarioTest.DoesNotExists) { CardData4Test card = TestData[key]; ExpectedResult = new ValidateResult { Result = card.ExpectedResult }; CardInfo cardtest = CardInfo.Create(card.Name, card.CardNo, card.ExpDate); var Test = _Repo.ValidateCardInfo(cardtest); Assert.AreEqual(ExpectedResult.Result, Test.Result); } } }
public UnitTest1() { TestData = new Dictionary <CardData4Test_key, CardData4Test>(); KeyTestData = new ArrayList(); CardData4Test_key Key; CardData4Test card; //DATA SET For Test card = CardData4Test.Create(ScenarioTest.ValidVISA, ValidateCardType.VISA, "Name LastName", "4567890123456789", "012020"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidVISA, ValidateCardType.VISA, "Name LastName", "4567890123456790", "012021"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidVISA, ValidateCardType.VISA, "Name LastName", "4567890123456791", "012022"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidVISA, ValidateCardType.VISA, "Name LastName", "4567890123456792", "012023"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidMASTER, ValidateCardType.MASTER, "Name LastName", "5678901234567890", "012021"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidMASTER, ValidateCardType.MASTER, "Name LastName", "5678901234567891", "012023"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidMASTER, ValidateCardType.MASTER, "Name LastName", "5678901234567892", "012017"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidMASTER, ValidateCardType.MASTER, "Name LastName", "5678901234567893", "012020"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidJCB, ValidateCardType.JCB, "Name LastName", "3456789012345678", "012099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidJCB, ValidateCardType.JCB, "Name LastName", "3456789012345679", "022099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidJCB, ValidateCardType.JCB, "Name LastName", "3456789012345680", "032099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidJCB, ValidateCardType.JCB, "Name LastName", "3456789012345681", "042099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidAMEX, ValidateCardType.AMEX, "Name LastName", "345678901234567", "012099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidAMEX, ValidateCardType.AMEX, "Name LastName", "345678901234568", "012099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidAMEX, ValidateCardType.AMEX, "Name LastName", "345678901234569", "012099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.ValidAMEX, ValidateCardType.AMEX, "Name LastName", "345678901234570", "012099"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.InvalidUnknown, ValidateCardType.Unknown, "Name LastName", "6678901234567889", "012019"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); card = CardData4Test.Create(ScenarioTest.DoesNotExists, ValidateStatus.DoesNotExists, "Name LastName", "5578901234567889", "012019"); Key = CardData4Test_key.CreateKey(card.TestScenario, card.CardNo); TestData.Add(Key, card); KeyTestData.Add(Key); }