示例#1
0
 public void RunOnZoningSetsZoneToNewZone()
 {
     // Fixture setup
     context.Player.Zone = NewZone;
     context.Player.Str  = 100;
     // Exercise system
     sut.Run(context);
     // Verify outcome
     Assert.Equal(NewZone, context.Zone);
     // Teardown
 }
        public void RunOnZoningStopsPlayerFromRunning()
        {
            // Fixture setup
            var api    = new FakeMemoryAPI();
            var player = new FakePlayer
            {
                Zone  = Zone.Konschtat_Highlands,
                Stats = new Structures.PlayerStats {
                    Str = 100
                }
            };

            var navigation = new Mock <INavigatorTools>();

            navigation.Setup(x => x.Reset());
            api.Player    = player;
            api.Navigator = navigation.Object;
            var sut = new ZoneState(api);

            player.Zone = Zone.Valkurm_Dunes;

            // Exercise system
            sut.Run();

            // Verify outcome
            navigation.Verify(x => x.Reset(), Times.Once());

            // Teardown
        }
        public void RunOnZoningSetsZoneToNewZone()
        {
            // Fixture setup
            var api    = new FakeMemoryAPI();
            var player = new FakePlayer
            {
                Zone  = Zone.Konschtat_Highlands,
                Stats = new Structures.PlayerStats {
                    Str = 100
                }
            };

            var navigation = new Mock <INavigatorTools>();

            api.Player    = player;
            api.Navigator = navigation.Object;
            var sut = new ZoneState(api);

            player.Zone = Zone.Valkurm_Dunes;

            // Exercise system
            sut.Run();

            // Verify outcome
            Assert.Equal(Zone.Valkurm_Dunes, sut.Zone);

            // Teardown
        }
        public void RunWhileZoningWaits()
        {
            // Fixture setup
            var api    = new FakeMemoryAPI();
            var player = new FakePlayer
            {
                Zone  = Zone.Konschtat_Highlands,
                Stats = new Structures.PlayerStats {
                    Str = 0
                }
            };

            var navigation = new Mock <INavigatorTools>();

            navigation.Setup(x => x.Reset());
            api.Player    = player;
            api.Navigator = navigation.Object;
            var sut = new ZoneState(api)
            {
                ZoningAction = () =>
                {
                    player.Stats = new Structures.PlayerStats
                    {
                        Str = 100
                    };
                }
            };

            player.Zone = Zone.Valkurm_Dunes;

            // Exercise system
            sut.Run();

            // Verify outcome
            Assert.Equal(100, player.Stats.Str);

            // Teardown
        }