public void TestMultiplyCommand() { var c = new MultiplyCommand(options); var actualResult = c.Execute(new long[] { 2, 2, 2 }); Assert.Equal(8, actualResult); }
static void Main(string[] args) { var receiver = new Calculator(345, 9945); var addCommand = new AddCommand(receiver); var subtractCommand = new SubtractCommand(receiver); var multiplyCommand = new MultiplyCommand(receiver); Console.WriteLine($"Add command result: {addCommand.Execute()}"); Console.WriteLine($"Subtract command result: {subtractCommand.Execute()}"); Console.WriteLine($"Multiply command result: {multiplyCommand.Execute()}"); Console.ReadKey(); }
public void Execute_MultiplyIsCalledWithNumberThree() { _command.Execute(); _mockCalculator.Verify(calculator => calculator.Multiply(It.Is <int>(i => i == _numberToMultiply))); }