コード例 #1
0
        public void WhenGetLocationWithNorthDirection()
        {
            var mockLocationCalc = new Mock <ILocationCalculator>();
            var northBound       = new NorthBound(mockLocationCalc.Object);
            var result           = northBound.GetLocation(new Position(new Location(1, 1), Direction.North), 1);

            Assert.Equal(1, result.location.X);
            Assert.Equal(2, result.location.Y);
        }
コード例 #2
0
        public void WhenGetLocationEastDirection()
        {
            var mockLocationCalc = new Mock <ILocationCalculator>();

            mockLocationCalc.Setup(c => c.GetLocation(It.IsAny <Position>(), 1));
            var northBound = new NorthBound(mockLocationCalc.Object);
            var result     = northBound.GetLocation(new Position(new Location(1, 1), Direction.East), 1);

            mockLocationCalc.Verify(calc => calc.GetLocation(It.IsAny <Position>(), 1));
        }