public void GetDiscountByNameDiscountNotFoundTest() { mockSecurityHelper.UserToReturn = "ContosoPartner1"; TestablePricing target = new TestablePricing(); target.ReplacementSecurityHelper = mockSecurityHelper; Discount actual; actual = target.GetDiscountByName("kajdfljad"); Assert.AreEqual(null, actual); }
public void GetDiscountByNameTest() { mockSecurityHelper.UserToReturn = "ContosoPartner1"; TestablePricing target = new TestablePricing(); target.ReplacementSecurityHelper = mockSecurityHelper; string expectedId = "1"; string expectedPartnerId = "ContosoPartner1"; string expectedProductSku = "1000000000"; string expectedName = "2 for 1"; decimal expectedValue = 50M; Discount actual; actual = target.GetDiscountByName("2 for 1"); Assert.AreEqual(expectedId, actual.Id); Assert.AreEqual(expectedPartnerId, actual.PartnerId); Assert.AreEqual(expectedProductSku, actual.ProductSku); Assert.AreEqual(expectedName, actual.Name); Assert.AreEqual(expectedValue, actual.Value); }