Пример #1
0
        public void ThrowsExceptionByInput(string input)
        {
            var fakeDeviceRepository = A.Fake<IDeviceRepository>();
            var fakeUsersReporisotyr = A.Fake<IUserRepository>();
            var fakeLogin = A.Fake<ILoginActions>();

            var commandParser = new DigitalHouse.BL.CommandParsers.CommandParser(fakeDeviceRepository, fakeUsersReporisotyr, fakeLogin);

            Assert.Throws<CommandParsingExecption>(() => commandParser.Parse(input));
        }
Пример #2
0
        public void InputOutputTest(string inputCommand, Type expectedParsing)
        {
            var fakeDeviceRepository = A.Fake<IDeviceRepository>();
            var fakeUsersReporisotyr = A.Fake<IUserRepository>();
            var fakeLogin = A.Fake<ILoginActions>();

            var commandParser = new DigitalHouse.BL.CommandParsers.CommandParser(fakeDeviceRepository, fakeUsersReporisotyr, fakeLogin);
            var command = commandParser.Parse(inputCommand);

            Assert.AreEqual(expectedParsing, command.GetType());
        }