Example #1
0
        public virtual async Task StoreDomainObjectSnapshot()
        {
            var item = new ConfigEnvironment(new EnvironmentIdentifier("Foo", "Bar"));

            item.Create();
            item.ImportKeys(new List <ConfigEnvironmentKey> {
                new ConfigEnvironmentKey("Jar", "Jar", "", "", 4711)
            });

            var snapshot = item.CreateSnapshot();

            var result = await Store.SaveSnapshots(new[] { snapshot });

            Assert.False(result.IsError, "result.IsError");
        }
Example #2
0
        public virtual async Task RetrieveDomainObjectSnapshot()
        {
            var item = new ConfigEnvironment(new EnvironmentIdentifier("Foo", "Bar"));

            item.Create();
            item.ImportKeys(new List <ConfigEnvironmentKey> {
                new ConfigEnvironmentKey("Jar", "Jar", "", "", 4711)
            });

            var snapshot = item.CreateSnapshot();

            await Store.SaveSnapshots(new[] { snapshot });

            var result = await Store.GetSnapshot <ConfigEnvironment>(new EnvironmentIdentifier("Foo", "Bar").ToString());

            Assert.False(result.IsError, "result.IsError");
            Assert.NotNull(result.Data);
            Assert.Equal(snapshot, result.Data);
        }