public void MustValidateWithErrorTextInputProductNew() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem(string.Concat(VALID_ENTRY, " ", "ProductNew")); Assert.False(vendorMachine.IsValid()); }
public void MustValidateCoinEntrySuccessfullyTest() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem(VALID_ENTRY); Assert.True(vendorMachine.IsValid()); }
public void MustValidateCoinEntryErrorTest() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem(INVALID_ENTRY); Assert.False(vendorMachine.IsValid()); }
public void MustSuccessfullyValidateCurrencySum() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem(VALID_ENTRY); Assert.True(vendorMachine.IsValid()); Assert.Equal((decimal)1.91, (decimal)vendorMachine.EnteredValue()); }
public void WhenRequestingMultipleProducts() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem("1.00 Pastelina Pastelina Pastelina"); Assert.True(vendorMachine.IsValid()); vendorMachine.CreateProductInput(); Assert.Equal("Output: Pastelina = 0.70 Pastelina = 0.40 Pastelina = 0.10", vendorMachine.OutputSystem()); }
public void WhenThereIsNoChange2() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem("0.25 0.05 0.05 Pastelina CHANGE"); Assert.True(vendorMachine.IsValid()); vendorMachine.CreateProductInput(); Assert.Equal("Output: Pastelina = 0.05", vendorMachine.OutputSystem()); }
public void InsertTooManyValueForProduct() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem("1.00 Pastelina CHANGE"); Assert.True(vendorMachine.IsValid()); vendorMachine.CreateProductInput(); Assert.Equal("Output: Pastelina = 0.70 0.50 0.10 0.10", vendorMachine.OutputSystem()); }
public void InsertCoinsAndRequestProduct() { SystemVendorMachine vendorMachine = new SystemVendorMachine(); vendorMachine.InputSystem("0.50 1.00 Coke"); Assert.True(vendorMachine.IsValid()); vendorMachine.CreateProductInput(); Assert.Equal("Output: Coke = 0.00", vendorMachine.OutputSystem()); }
static void Main(string[] args) { SystemVendorMachine vendorMachine = new SystemVendorMachine(); while (!vendorMachine.IsValid()) { Console.WriteLine("Coins are 0.01, 0.05, 0.10, 0.25, 0.50 and 1.00"); Console.WriteLine("Products are Coke (cost 1.50), Water (cost: 1.00) and Pastelina (cost: 0.30)"); Console.Write("Input: "); vendorMachine.InputSystem(Console.ReadLine()); } vendorMachine.CreateProductInput(); vendorMachine.OutputSystem(); Console.WriteLine("Hello World!"); Console.ReadKey(); }