public void PaymentRepository_NullReferenceException_Failed() { //Arrange var repo = new PaymentRepository(_mockDataSource.Object); //Act and Assert Assert.ThrowsExceptionAsync <NullReferenceException>(() => repo.AddItemAsync(null), "Null Reference Exception. Parameter cannot be null."); }
public void PaymentRepository_AddItemAsync_Payment_Already_Exists_Failed() { //Arrange var repo = new PaymentRepository(_mockDataSource.Object); //Act var result = repo.AddItemAsync(_payment).Result; //Assert Assert.IsNotNull(result); Assert.IsFalse(result); }
public void PaymentRepository_AddItemAsync_Payment_No_Exists_Successful() { //Arrange var repo = new PaymentRepository(_mockDataSource.Object); //Act //Simulates a Non Existing payment in Storage var temp = new Payment(); var result = repo.AddItemAsync(temp).Result; //Assert Assert.IsNotNull(result); Assert.IsTrue(result); }