Пример #1
0
        public void Execute_AddFunction_FunctionWillBeAdded()
        {
            var          fs             = new FunctionStorage();
            var          command        = new AddInStorage("name", new Cos());
            var          res            = command.Execute(fs);
            const string expectedResult = "Функция добавлена";

            Assert.AreEqual(expectedResult, res);
        }
Пример #2
0
        public void Execute_AddExistingFunctionFunction_ErrorReturned()
        {
            var fs      = new FunctionStorage();
            var command = new AddInStorage("name", new Cos());

            fs.Add("name", new Sin());
            var          res            = command.Execute(fs);
            const string expectedResult = "name уже используется";

            Assert.AreEqual(expectedResult, res);
        }