public void FromFactory_can_create_instance() { bool invoked = false; var pp = PropertyProvider.FromFactory(() => { invoked = true; return(PropertyProvider.Null); }); Assert.Equal(null, pp.GetProperty("s")); Assert.True(invoked); }
public void FromFactory_can_create_instance_from_container() { var container = new PPropertiesContainer(); bool invoked = false; var pp = PropertyProvider.FromFactory(() => { invoked = true; return(container); }); Assert.Equal("hello", pp.GetProperty("s")); Assert.True(invoked); }