public void IsValidTest() { //Arrange ICommand innerCommand = MockRepository.GenerateStrictMock <ICommand>(); innerCommand.Expect(ic => ic.IsValid()). Repeat.Once(). Return(true); SwitchCommand command = new SwitchCommand(innerCommand); //Act bool isValidResult = command.IsValid(); //Assert Assert.IsTrue(isValidResult); innerCommand.VerifyAllExpectations(); }