public static void Main() { var productComparer = new ProductComparer(); productComparer.Add(new Product(TariffConstants.BasicTariffName)); productComparer.Add(new Product(TariffConstants.PackagedTariffName)); productComparer.CompareAndPrint(3500); productComparer.CompareAndPrint(4500); productComparer.CompareAndPrint(6000); }
public void CompareAndPrintShouldSuccess() { // Arrange var productComparer = new ProductComparer(); var product1 = new Product(TariffConstants.BasicTariffName); var product2 = new Product(TariffConstants.PackagedTariffName); // Act productComparer.Add(product1); productComparer.Add(product2); productComparer.CompareAndPrint(3400); }
public void AddShouldThrowArgumentNullExceptionWhenOtherIsNull() { // Arrange var productComparer = new ProductComparer(); // Act productComparer.Add(null); }
public void CompareShouldReturnListWithCorrectOrder() { // Arrange var productComparer = new ProductComparer(); var product1 = new Product(TariffConstants.BasicTariffName); var product2 = new Product(TariffConstants.PackagedTariffName); var expectedResult = new List <Product>(); expectedResult.Add(product2); expectedResult.Add(product1); // Act productComparer.Add(product1); productComparer.Add(product2); var actualResult = productComparer.Compare(3400).ToList(); // Assert CollectionAssert.AreEqual(expectedResult, actualResult); }
public void AddShouldSuccess() { // Arrange var name = TariffConstants.BasicTariffName; var product = new Product(name); var productComparer = new ProductComparer(); // Act productComparer.Add(product); }