Ejemplo n.º 1
0
        public void Should_return_null_when_removing_references_from_null_json_array()
        {
            var sut = new AssetsField(1, "my-asset", Partitioning.Invariant);

            var result = sut.RemoveDeletedReferences(JValue.CreateNull(), null);

            Assert.Null(result);
        }
Ejemplo n.º 2
0
        public void Should_remove_deleted_references()
        {
            var id1 = Guid.NewGuid();
            var id2 = Guid.NewGuid();

            var sut = new AssetsField(1, "my-asset", Partitioning.Invariant);

            var result = sut.RemoveDeletedReferences(CreateValue(id1, id2), new HashSet <Guid>(new[] { id2 }));

            Assert.Equal(CreateValue(id1), result);
        }
Ejemplo n.º 3
0
        public void Should_return_same_token_when_removing_references_and_nothing_to_remove()
        {
            var id1 = Guid.NewGuid();
            var id2 = Guid.NewGuid();

            var sut = new AssetsField(1, "my-asset", Partitioning.Invariant);

            var token  = CreateValue(id1, id2);
            var result = sut.RemoveDeletedReferences(token, new HashSet <Guid>(new[] { Guid.NewGuid() }));

            Assert.Same(token, result);
        }