Esempio n. 1
0
        public void Enchant_PerformCommand_NoParameter()
        {
            Mock <IMobileObject> mob         = new Mock <IMobileObject>();
            Mock <ICommand>      mockCommand = new Mock <ICommand>();

            mockCommand.Setup(e => e.Parameters).Returns(new List <IParameter>());

            IResult result = command.PerformCommand(mob.Object, mockCommand.Object);

            Assert.IsTrue(result.AllowAnotherCommand);
            Assert.AreEqual("What would you like to enchant?", result.ResultMessage);
        }
Esempio n. 2
0
        public void Enchant_PerformCommand_NoParameter()
        {
            Mock <IMobileObject> mob         = new Mock <IMobileObject>();
            Mock <ICommand>      mockCommand = new Mock <ICommand>();
            Mock <ITagWrapper>   tagWrapper  = new Mock <ITagWrapper>();

            tagWrapper.Setup(e => e.WrapInTag("What would you like to enchant?", TagType.Info)).Returns("message");
            mockCommand.Setup(e => e.Parameters).Returns(new List <IParameter>());

            GlobalReference.GlobalValues.TagWrapper = tagWrapper.Object;

            IResult result = command.PerformCommand(mob.Object, mockCommand.Object);

            Assert.IsFalse(result.ResultSuccess);
            Assert.AreEqual("message", result.ResultMessage);
        }