Beispiel #1
0
 public void MockBot_MustHaveVersion()
 {
     Assert.Throws <BdBaseException>(() => {
         BasicMockBot sut = new BasicMockBot();
         sut.Mock_SetNameVer("Nameeeee", "");
     });
 }
Beispiel #2
0
 public void CreateMockBot_EmptyNameThrowsException()
 {
     Assert.Throws <BdBaseException>(() => {
         BasicMockBot sut = new BasicMockBot();
         sut.Mock_SetNameVer("", "1.0.0.1");
     });
 }
Beispiel #3
0
 public void MockBot_VersionNotNull()
 {
     Assert.Throws <BdBaseException>(() => {
         BasicMockBot sut = new BasicMockBot();
         sut.Mock_SetNameVer("Nameeeee", null);
     });
 }
Beispiel #4
0
        public void CreateMockBot_AllowsSetVersion()
        {
            var sut = new BasicMockBot();

            sut.Mock_SetNameVer("Nameeeee", "1.0.0.1");
            Assert.Equal("1.0.0.1", sut.Version);
        }
Beispiel #5
0
 public void CreateMockBot_NullNameThrowsException()
 {
     Assert.Throws <BdBaseException>(() => {
         var sut = new BasicMockBot();
         sut.Mock_SetNameVer(null, "1.0.0.1");
     });
 }
Beispiel #6
0
        public void CreateMockBot_AllowsSetName()
        {
            var sut = new BasicMockBot();

            sut.Mock_SetNameVer("Nameeeee", "Verrrrr");
            Assert.Equal("Nameeeee", sut.Name);
        }
Beispiel #7
0
        public void Equipment_TooBigForTurrent_FailsToInstall()
        {
            var sut = new MockBotFactory().CreateBasicMockBot().WithMockActionProvider().WithItemSupport().ToBot();

            var          kit = sut.InstallEquipment(KnownEquipmentIds.MOCKWAYTOOBIG, "Test Equipment1", MountPoint.Turret);
            BasicMockBot bmb = (BasicMockBot)sut;

            Assert.NotNull(kit);
            Assert.Equal(InstallationResult.Fail_NoSpace, kit.Result);
        }
Beispiel #8
0
        public void Equipment_Install_AddsToCount()
        {
            var          sut = new MockBotFactory().CreateBasicMockBot().WithMockActionProvider().WithItemSupport().ToBot();
            BasicMockBot bmb = (BasicMockBot)sut;

            int preInstall  = bmb.GetEquipmentCount();
            var kit         = sut.InstallEquipment(KnownEquipmentIds.MOCKINSTALLEVERYWHERE, "Teste Equipment1", MountPoint.Internal);
            int postInstall = bmb.GetEquipmentCount();

            Assert.Equal(preInstall + 1, postInstall);
        }
Beispiel #9
0
        public void Equipment_Install_ReturnsSuccess()
        {
            var          sut = new MockBotFactory().CreateBasicMockBot().WithMockActionProvider().WithItemSupport().ToBot();
            BasicMockBot bmb = (BasicMockBot)sut;

            int preInstall = bmb.GetEquipmentCount();
            var kit        = sut.InstallEquipment(KnownEquipmentIds.MOCKINSTALLEVERYWHERE, "Teste Equipment1", MountPoint.Internal);

            Assert.NotNull(kit);
            Assert.Equal(InstallationResult.Installed, kit.Result);
        }
Beispiel #10
0
 public TestEngineFactory WithBot(BoonBotBase thisOne = null)
 {
     if (thisOne == null)
     {
         var bmb = new BasicMockBot();
         bmb.AddMockPowerpack = true;
         thisOne = bmb;
         WithEquipmentSupport();
     }
     addTheseBots.Add(thisOne);
     return(this);
 }
Beispiel #11
0
        public void Equipment_InstallTurret_AddsToTurretCount()
        {
            var mbf = new MockBotFactory().CreateBasicMockBot().WithMockActionProvider().WithItemSupport();
            var sut = mbf.ToBot();

            var          map        = mbf.MockActionProviderUsed;
            BasicMockBot bmb        = (BasicMockBot)sut;
            int          preInstall = map.Mock_GetEquipmentCountAtPosition(MountPoint.Turret);

            var kit = sut.InstallEquipment(KnownEquipmentIds.MOCKINSTALLEVERYWHERE, "Teste Equipment1", MountPoint.Turret);

            int postInstall = map.Mock_GetEquipmentCountAtPosition(MountPoint.Turret);

            Assert.Equal(preInstall + 1, postInstall);
        }
Beispiel #12
0
 public MockBotFactory CreateMockWithName(string name, string version)
 {
     result = new BasicMockBot();
     return(this);
 }
Beispiel #13
0
 public MockBotFactory CreateBasicMockBot()
 {
     result = new BasicMockBot();
     return(this);
 }