Exemple #1
0
        public async Task CreateWithoutCache()
        {
            var cascade = new CascadeDataLayer(origin, new ICascadeCache[] {}, new CascadeConfig());
            var parent  = new Parent()
            {
                colour = "red"
            };

            parent = await cascade.Create <Parent>(parent);

            Assert.AreEqual(5, parent !.id);
            Assert.AreEqual("red", parent !.colour);
        }
Exemple #2
0
        public async Task CreateReplaceWithoutCache()
        {
            var cascade = new CascadeDataLayer(origin, new ICascadeCache[] {}, new CascadeConfig());
            var parent  = new Parent()
            {
                colour = "red"
            };

            parent = await cascade.Create(parent);

            var parent2 = new Parent()
            {
                id     = parent.id,
                colour = "green"
            };

            parent2 = await cascade.Replace(parent2);

            Assert.AreEqual(5, parent2.id);
            Assert.AreEqual("green", parent2 !.colour);
        }