Пример #1
0
        public void FailureCase4Test()
        {
            string temperature = Temperature.COLD.ToString();

            int[] cmds = new int[] { (int)CommandID.pants };

            var commandProcessor = new CommandProcessorWrapper(new RuleProcessor(), new CommandFactory());
            var output           = commandProcessor.ProcessCmds(cmds, Temperature.COLD);

            Assert.AreEqual(1, output.Count, "Incorrect number of output commands received");
            Assert.IsTrue(output.ContainsKey((int)CommandID.fail), "expected command not found");
        }
Пример #2
0
        public void SuccessCase1Test()
        {
            string temperature = Temperature.HOT.ToString();

            int[] cmds = new int[] { (int)CommandID.takeOffPjs, (int)CommandID.pants, (int)CommandID.shirt, (int)CommandID.headwear, (int)CommandID.footwear, (int)CommandID.leaveHouse };

            var commandProcessor = new CommandProcessorWrapper(new RuleProcessor(), new CommandFactory());
            var output           = commandProcessor.ProcessCmds(cmds, Temperature.HOT);

            Assert.AreEqual(6, output.Count, "Incorrect number of output commands received");
            Assert.IsTrue(output.ContainsKey((int)CommandID.takeOffPjs), "expected command not found");
            Assert.IsTrue(output.ContainsKey((int)CommandID.pants), "expected command not found");
            Assert.IsTrue(output.ContainsKey((int)CommandID.shirt), "expected command not found");
            Assert.IsTrue(output.ContainsKey((int)CommandID.headwear), "expected command not found");
            Assert.IsTrue(output.ContainsKey((int)CommandID.footwear), "expected command not found");
            Assert.IsTrue(output.ContainsKey((int)CommandID.leaveHouse), "expected command not found");
        }