public void CanCallHasProperty() { var api = new TestApi(serviceProvider); var name = "TestValue183810822"; api.SetProperty(name, "Test"); var result = api.HasProperty(name); result.Should().BeTrue("Property has to be set"); }
public void PropertyBagManipulatesPropertiesCorrectly() { var context = new TestApi().Context; Assert.False(context.HasProperty("Test")); Assert.Null(context.GetProperty("Test")); Assert.Null(context.GetProperty <string>("Test")); Assert.Equal(default(int), context.GetProperty <int>("Test")); context.SetProperty("Test", "Test"); Assert.True(context.HasProperty("Test")); Assert.Equal("Test", context.GetProperty("Test")); Assert.Equal("Test", context.GetProperty <string>("Test")); context.ClearProperty("Test"); Assert.False(context.HasProperty("Test")); Assert.Null(context.GetProperty("Test")); Assert.Null(context.GetProperty <string>("Test")); Assert.Equal(default(int), context.GetProperty <int>("Test")); }