Exemplo n.º 1
0
        public void Merging_should_combine_recreate_graph_with_another_by_discarding_the_former()
        {
            // given
            var graphFirst  = new[] { AQuad };
            var graphSecond = new[] { CQuad, BQuad };
            var update      = new GraphReconstruct(EntityId, GraphId, graphFirst);
            var other       = new GraphReconstruct(EntityId, GraphId, graphSecond);

            // when
            var merged = (GraphReconstruct)update.MergeWith(other);

            // then
            merged.Should().Be(other);
        }
Exemplo n.º 2
0
        public void Merging_should_combine_recreate_graph_with_update()
        {
            // given
            var newGraph     = new[] { AQuad, CQuad };
            var removedQuads = new[] { AQuad };
            var addedQuads   = new[] { CQuad, BQuad };
            var update       = new GraphReconstruct(EntityId, GraphId, newGraph);
            var other        = new GraphUpdate(EntityId, GraphId, removedQuads, addedQuads);

            // when
            var merged = (GraphReconstruct)update.MergeWith(other);

            // then
            merged.AddedQuads.Should().Contain((IEnumerable)addedQuads);
        }