示例#1
0
        public void BattleSettingsModel_Constructor_Default_Should_Pass()
        {
            // Arrange

            // Act
            var result = new BattleSettingsModel();

            // Reset

            // Assert
            Assert.AreEqual("Simple Next", result.BattleModeEnum.ToMessage());
        }
        public static BattleSettingsModel ToModel(this BattleSettings battleSettings)
        {
            var model = new BattleSettingsModel()
            {
                BattleHostPictureBattleSponsorshipPercentage = battleSettings.BattleHostPictureBattleSponsorshipPercentage,
                BattleHostVideoBattleSponsorshipPercentage   = battleSettings.BattleHostVideoBattleSponsorshipPercentage,
                DefaultVideosFeaturedImageUrl               = battleSettings.DefaultVideosFeaturedImageUrl,
                DefaultVotingChargeForPaidVoting            = battleSettings.DefaultVotingChargeForPaidVoting,
                SiteOwnerPictureBattleSponsorshipPercentage = battleSettings.SiteOwnerPictureBattleSponsorshipPercentage,
                SiteOwnerVideoBattleSponsorshipPercentage   = battleSettings.SiteOwnerVideoBattleSponsorshipPercentage
            };

            return(model);
        }
示例#3
0
        public IHttpActionResult Post(BattleSettingsModel entityModel)
        {
            var battleSettings = new BattleSettings()
            {
                BattleHostPictureBattleSponsorshipPercentage = entityModel.BattleHostPictureBattleSponsorshipPercentage,
                BattleHostVideoBattleSponsorshipPercentage   = entityModel.BattleHostVideoBattleSponsorshipPercentage,
                DefaultVideosFeaturedImageUrl               = entityModel.DefaultVideosFeaturedImageUrl,
                DefaultVotingChargeForPaidVoting            = entityModel.DefaultVotingChargeForPaidVoting,
                SiteOwnerPictureBattleSponsorshipPercentage = entityModel.SiteOwnerPictureBattleSponsorshipPercentage,
                SiteOwnerVideoBattleSponsorshipPercentage   = entityModel.SiteOwnerVideoBattleSponsorshipPercentage
            };

            _settingService.Save(battleSettings);
            VerboseReporter.ReportSuccess("Settings saved successfully", "post_setting");
            return(RespondSuccess(new { BattleSettings = battleSettings.ToModel() }));
        }
        public void BattleSettingsModelTests_Constructor_Default_Should_Pass()
        {
            // Arrange

            // Act
            var result = new BattleSettingsModel();

            // Reset

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(false, result.AllowCriticalHit);
            Assert.AreEqual(false, result.AllowCriticalMiss);
            Assert.AreEqual(false, result.AllowMonsterItems);
            Assert.AreEqual(BattleModeEnum.SimpleNext, result.BattleModeEnum);
            Assert.AreEqual(HitStatusEnum.Default, result.CharacterHitEnum);
            Assert.AreEqual(HitStatusEnum.Default, result.MonsterHitEnum);
        }