示例#1
0
        public void Look_Plus_Garbage_Should_Return_Quote_I_Dont_See_That_Here()
        {
            // Arrange
            // Already created via TestInitialize

            // Act
            var result = cmd.IsValid("look stupid");

            // Assert
            mock.AssertWasCalled(qq => qq.WriteLine("I don't see that here."));
        }
示例#2
0
        public void Execute_Should_Write_to_Console_LOL_Plus_All_But_First_Word()
        {
            // Arrange


            // Act
            cmd.Execute("lol blah");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("You laugh at {0}. Tee Hee!", "blah"));
        }
示例#3
0
        public void Execute_Should_Write_To_Console_All_But_First_Word_In_Caps_And_Red()
        {
            //Arrange

            //Act
            cmd.Execute("yell idiot");

            //Assert
            mock.AssertWasCalled((m => m.ForegroundColor = ConsoleColor.Red));
            mock.AssertWasCalled(m => m.WriteLine("IDIOT"));
            mock.AssertWasCalled(m => m.ResetColor());
        }
示例#4
0
        public void Execute_Should_Write_To_Console_Yell_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("yell blah");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("BLAH"));
            mock.AssertWasCalled(m => m.ForegroundColor = ConsoleColor.Red);
            mock.AssertWasCalled(m => m.ResetColor());
        }
示例#5
0
        public void Execute_Should_Write_To_Console_You_Slap_Plus_All_But_First_Word()
        {
            //Arrange

            //Act
            cmd.Execute("slap myself");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("You slap {0} upside the head.", "myself"));
        }
示例#6
0
        public void Execute_Should_Write_To_Console_Panic_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("panic the evening news");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("One look at {0} sends you into a panic.", "the evening news"));
        }
示例#7
0
        public void Execute_Should_Write_To_Console_Bonk_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("bonk someone");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("You bonk {0} on the head. Ouch!", "someone"));
        }
示例#8
0
        public void Execute_Should_Write_To_Console_Does_Not_Compute()
        {
            //Arrange

            //Act
            cmd.Execute("Stupid stuff goes here");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("Does Not Compute!"));
        }
        public void Execute_Should_Write_To_Console_All_But_First_Word()
        {
            //Arrange

            //Act
            cmd.Execute("echo this is a test");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("this is a test"));
        }
示例#10
0
        public void Execute_Should_Write_To_Console_Angry_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("angry blah");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("You shake your fist at blah in anger."));
        }
示例#11
0
        public void Execute_Should_Write_To_Console_Clap_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("clap blah");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("You applaud at blah. Bravo!"));
        }
示例#12
0
        public void Execute_Should_Write_To_Console_Glare_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("glare blah");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("You fix blah with a baleful glare."));
        }
示例#13
0
        public void Execute_Should_Write_To_Console_You_Examine_The_Plus_All_But_First_Word()
        {
            //Arrange

            //Act
            cmd.Execute("examine trash");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("You examine the {0}.", "trash"));
        }
示例#14
0
        public void Execute_Should_Write_To_Console_You_Open_The_Plus_All_But_First_Word_Plus_Ending_Text()
        {
            //Arrange

            //Act
            cmd.Execute("open door");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("You open the {0} and peek at what's inside.", "door"));
        }
示例#15
0
        public void Execute_Should_Write_To_Console_Dance_Plus_All_But_First_Word()
        {
            // Arrange

            // Act
            cmd.Execute("dance blah");

            // Assert
            mock.AssertWasCalled(m => m.WriteLine("You gracefully dance the {0}.", "blah"));
        }
        public void Execute_Should_Write_To_Console_Wave_Plus_All_But_First_Word()
        {
            //Arrange

            //Act
            cmd.Execute("wave to my friends");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("You wave at {0}.", "to my friends"));
        }
示例#17
0
        public void Execute_Should_Write_To_Console_Cheer_Plus_All_But_First_Word()
        {
            //Arrange

            //Act
            cmd.Execute("cheer everybody around");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("You cheer for {0}.", "everybody around"));
        }
        public void Execute_Should_Write_To_Console_You_Make_A_Rude_Comment_To_Plus_All_But_First_Word()
        {
            //Arrange

            //Act
            cmd.Execute("rude the folks around");

            //Assert
            mock.AssertWasCalled(m => m.WriteLine("You make a rude comment to {0}.", "the folks around"));
        }
        public void Execute_Should_List_Contents_Of_Inventory()
        {
            // Arrange
            repository.Stub(gg => gg.AsQueryable()).Return(new List <Item>
            {
                new Item {
                    RoomId = 2, ItemName = "sword"
                }
            }.AsQueryable());

            // Act
            cmd.Execute("inventory");

            // Assert
            mock.AssertWasCalled(m => m.Write("{0}  ", "sword"));
            repository.AssertWasCalled(m => m.Dispose());
        }