public void SubSubProperty() { var store = new DictionaryKVStore(); var target = KeyValueProxyFactory.Create <IPerson>(store); target.Address.State.PropertyChanged += State_PropertyChanged; target.Address.State.Code = "test"; target.Address.State.Code.Should().Be("test"); store.Store.Should().Contain("Address.State.Code", "test"); }
public async Task SubProperty() { var store = new DictionaryKVStore(); var target = KeyValueProxyFactory.Create <IPerson>(store); target.Address.Street = "test"; target.Address.Street.Should().Be("test"); target.Address.SetPostalCode("test2"); target.Address.GetPostalCode().Should().Be("test2"); await target.Address.SetCity("test2"); (await target.Address.GetCity()).Should().Be("test2"); store.Store.Should().Contain("Address.Street", "test"); }
public async Task RegularProperty() { var store = new DictionaryKVStore(); var target = KeyValueProxyFactory.Create <IPerson>(store); target.SetFirstName("test"); target.GetFirstName().Should().Be("test"); await target.SetLastName("test2"); (await target.GetLastName()).Should().Be("test2"); target.Age = 1; target.Age.Should().Be(1); store.Store.Should().Contain("FirstName", "test"); store.Store.Should().Contain("LastName", "test2"); target.PropertyChanged += Target_PropertyChanged; target.Age = 1; target.PropertyChanged -= Target_PropertyChanged; target.Age = 1; gotEvent.Should().BeTrue(); }