public void TestMultiplyCommand()
        {
            var c            = new MultiplyCommand(options);
            var actualResult = c.Execute(new long[] { 2, 2, 2 });

            Assert.Equal(8, actualResult);
        }
Пример #2
0
        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();
        }
Пример #3
0
 public void Execute_MultiplyIsCalledWithNumberThree()
 {
     _command.Execute();
     _mockCalculator.Verify(calculator => calculator.Multiply(It.Is <int>(i => i == _numberToMultiply)));
 }