Ejemplo n.º 1
0
        public void Properties_NotEmpty_AfterCreateOne(UniverseSources source)
        {
            var asyncProperties = new AsyncProperties(Universe(source).Properties());

            asyncProperties.Create("Test Property");
            Assert.IsTrue(asyncProperties.Any());
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 4
0
        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());
        }
Ejemplo n.º 5
0
 public CreateProperty(AsyncProperties properties)
 {
     _properties = properties;
 }