public void Properties_NotEmpty_AfterCreateOne(UniverseSources source) { var asyncProperties = new AsyncProperties(Universe(source).Properties()); asyncProperties.Create("Test Property"); Assert.IsTrue(asyncProperties.Any()); }
public void Properties_Empty_AfterDelete(UniverseSources source) { var asyncProperties = new AsyncProperties(Universe(source).Properties()); asyncProperties.Create("Test Property"); asyncProperties.First().Delete(); Assert.IsFalse(asyncProperties.Any()); }
public ListPropertiesViewModel(IUniverse universe) { _properties = new AsyncProperties(universe.Properties()); _properties.NewPropertyEvent += (sender, args) => _addProperty(args.Property); CreateProperty = new CreateProperty(_properties); _loadProperties(); }
public async Task CreateAsync_InvokeEvent(UniverseSources source) { var value = "TestPropertyValue"; var asyncProperties = new AsyncProperties(Universe(source).Properties()); var eventInvoked = false; asyncProperties.NewPropertyEvent += (sender, args) => eventInvoked = true; var property = await asyncProperties.CreateAsync(value); Assert.AreEqual(property.Value(), property.Value()); Assert.IsTrue(eventInvoked); Assert.IsTrue(asyncProperties.Any()); }
public CreateProperty(AsyncProperties properties) { _properties = properties; }