Example #1
0
        public void SetRecieverShouldHaveRecievers(Mock <LocationValidator> validator, Location location, Direction direction, Mock <IRover> rover, Mock <IPlateu> plateu)
        {
            var sut = new LandingCommand(validator.Object, location, direction);

            Action actual = () => sut.SetReceivers(rover.Object, plateu.Object);

            actual.Should().NotThrow <System.Exception>();
        }
Example #2
0
        public void SetRecieversAndExecuteShouldFireRoverLand(Mock <LocationValidator> validator, Location location, Direction direction, [Frozen] Mock <IRover> rover, [Frozen] Mock <IPlateu> plateu)
        {
            var sut = new LandingCommand(validator.Object, location, direction);

            sut.SetReceivers(rover.Object, plateu.Object);

            sut.Execute();

            rover.Verify(p => p.Land(plateu.Object, location, direction), Times.Once);
        }
Example #3
0
        public void ConstructorShouldSetProperties(Mock <LocationValidator> validator, Location location, Direction direction)
        {
            var sut = new LandingCommand(validator.Object, location, direction);

            var actualLocation  = sut.Location;
            var actualDirection = sut.Direction;

            actualLocation.Should().Be(location);
            actualDirection.Should().Be(direction);
        }