public async Task GetValueShouldReturnStringValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act string value = await featuresService.GetValue <string>("Theme"); // Assert value.ShouldBe("light"); }
public async Task GetValueShouldFailIfMismatchTypeForStringValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act var exception = await featuresService.GetValue <decimal>("Theme").ShouldThrowAsync <Exception>(); // Assert exception.Message.ShouldBe("The feature Theme is a string feature..."); }
public async Task GetValueShouldReturnDecimalValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act decimal value = await featuresService.GetValue <decimal>("TaxPercent"); // Assert value.ShouldBe(12.5m); }
public async Task GetValueShouldFailIfMismatchTypeForIntValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act var exception = await featuresService.GetValue <bool>("Delay").ShouldThrowAsync <Exception>(); // Assert exception.Message.ShouldBe("The feature Delay is an integer feature..."); }
public async Task GetValueShouldReturnIntValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act int value = await featuresService.GetValue <int>("Delay"); // Assert value.ShouldBe(1000); }
public async Task GetValueShouldFailIfMismatchTypeForBooleanValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act var exception = await featuresService.GetValue <string>("Beta").ShouldThrowAsync <Exception>(); // Assert exception.Message.ShouldBe("The feature Beta is a boolean feature..."); }
public async Task GetValueShouldReturnBooleanValue() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); // Act bool value = await featuresService.GetValue <bool>("Beta"); // Assert value.ShouldBeTrue(); }
public async Task GetValueShouldFailIfNoFeatureFound() { // Arrange InitializeFeaturesData(); var featuresService = new FeaturesService(_db, new Settings()); string featureName = "X"; // Act var exception = await featuresService.GetValue <string>(featureName).ShouldThrowAsync <Exception>(); // Assert exception.Message.ShouldBe($"The feature {featureName} does not exist..."); }