コード例 #1
0
        public void IsAnInstanceOfICommand()
        {
            var fakeFactory = new Mock <IBattleShipFactory>();
            var fakeEngine  = new Mock <IEngine>();
            var mockFactory = new FakeCreateSubmarineCommand(fakeFactory.Object, fakeEngine.Object);

            Assert.IsInstanceOfType(mockFactory, typeof(ICommand));
        }
コード例 #2
0
        public void SetTheFieldEngine()
        {
            //Arrange
            var fakeFactory = new Mock <IBattleShipFactory>();
            var fakeEngine  = new Mock <IEngine>();
            var mockFactory = new FakeCreateSubmarineCommand(fakeFactory.Object, fakeEngine.Object);

            //Act & Assert
            Assert.AreSame(fakeEngine.Object, mockFactory.Engine);
        }