Esempio n. 1
0
 public void MockBot_MustHaveVersion()
 {
     Assert.Throws <BdBaseException>(() => {
         BasicMockBot sut = new BasicMockBot();
         sut.Mock_SetNameVer("Nameeeee", "");
     });
 }
Esempio n. 2
0
 public void CreateMockBot_EmptyNameThrowsException()
 {
     Assert.Throws <BdBaseException>(() => {
         BasicMockBot sut = new BasicMockBot();
         sut.Mock_SetNameVer("", "1.0.0.1");
     });
 }
Esempio n. 3
0
 public void MockBot_VersionNotNull()
 {
     Assert.Throws <BdBaseException>(() => {
         BasicMockBot sut = new BasicMockBot();
         sut.Mock_SetNameVer("Nameeeee", null);
     });
 }
Esempio n. 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);
        }
Esempio n. 5
0
 public void CreateMockBot_NullNameThrowsException()
 {
     Assert.Throws <BdBaseException>(() => {
         var sut = new BasicMockBot();
         sut.Mock_SetNameVer(null, "1.0.0.1");
     });
 }
Esempio n. 6
0
        public void CreateMockBot_AllowsSetName()
        {
            var sut = new BasicMockBot();

            sut.Mock_SetNameVer("Nameeeee", "Verrrrr");
            Assert.Equal("Nameeeee", sut.Name);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
 }
Esempio n. 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);
        }
Esempio n. 12
0
 public MockBotFactory CreateMockWithName(string name, string version)
 {
     result = new BasicMockBot();
     return(this);
 }
Esempio n. 13
0
 public MockBotFactory CreateBasicMockBot()
 {
     result = new BasicMockBot();
     return(this);
 }