public void ValidateBonusType_WhenANotStakebleBonusTypeForStackableConditionPassed_ReturnInValidValidationResult() { //Arrange var bonusTypeServiceMock = new Mock <IBonusTypeService>(); var condition = new Domain.Models.Condition() { BonusType = new Domain.Models.BonusType { Type = "type" }, HasStaking = true }; bonusTypeServiceMock.Setup(b => b.GetAsync(It.IsAny <string>())) .ReturnsAsync(new Domain.Models.BonusType() { IsAvailable = true, IsStakeable = false }); var bonusTypeValidationService = new BonusTypeValidationService(bonusTypeServiceMock.Object); //Act var result = bonusTypeValidationService.ValidateBonusType(condition.BonusType.Type, condition.HasStaking); //Assert Assert.False(result.IsValid); Assert.Equal("Condition Type type is not stakeable Type", result.ValidationMessages.First()); }
public void ValidateBonusType_WhenBonusTypeForNonStackableConditionPassed_ReturnValidValidationResult() { //Arrange var bonusTypeServiceMock = new Mock <IBonusTypeService>(); var condition = new Domain.Models.Condition() { BonusType = new Domain.Models.BonusType { Type = "type" }, HasStaking = false }; bonusTypeServiceMock.Setup(b => b.GetAsync(It.IsAny <string>())) .ReturnsAsync(new Domain.Models.BonusType() { IsAvailable = true, IsStakeable = true }); var bonusTypeValidationService = new BonusTypeValidationService(bonusTypeServiceMock.Object); //Act var result = bonusTypeValidationService.ValidateBonusType(condition.BonusType.Type, condition.HasStaking); //Assert Assert.True(result.IsValid); }