Exemplo n.º 1
0
        public void change_is_cleared()
        {
            var target = Target.Random();
            var entity = new TrackedEntity(target.Id, new TestsSerializer(), typeof(Target), target, null);

            target.Long++;

            var change = entity.DetectChange();

            change.ChangeCommitted();

            SpecificationExtensions.ShouldBeNull(entity.DetectChange());
        }
Exemplo n.º 2
0
        public void change_is_cleared()
        {
            var target = Target.Random();
            var entity = new TrackedEntity(target.Id, new JilSerializer(), typeof(Target), target);

            target.Long++;

            var change = entity.DetectChange();

            change.ChangeCommitted();

            entity.DetectChange().ShouldBeNull();
        }
Exemplo n.º 3
0
        public void detect_changes_negative()
        {
            var target = Target.Random();
            var entity = new TrackedEntity(target.Id, new JilSerializer(), typeof(Target), target);

            entity.DetectChange().ShouldBeNull();
        }
Exemplo n.º 4
0
        public void detect_changes_negative()
        {
            var target = Target.Random();
            var entity = new TrackedEntity(target.Id, new TestsSerializer(), typeof(Target), target, null);

            SpecificationExtensions.ShouldBeNull(entity.DetectChange());
        }
Exemplo n.º 5
0
        public void detect_changes_positive()
        {
            var target = Target.Random();
            var entity = new TrackedEntity(target.Id, new JilSerializer(), typeof(Target), target);

            target.Long++;

            var change = entity.DetectChange();

            change.ShouldNotBeNull();
            change.DocumentType.ShouldBe(typeof(Target));
            change.Id.ShouldBe(target.Id);
            change.Json.ShouldBe(new JilSerializer().ToJson(target));
        }
Exemplo n.º 6
0
        public void detect_changes_with_no_document()
        {
            var entity = new TrackedEntity(Guid.NewGuid(), new JilSerializer(), typeof(Target), null);

            entity.DetectChange().ShouldBeNull();
        }
Exemplo n.º 7
0
        public void detect_changes_with_no_document()
        {
            var entity = new TrackedEntity(Guid.NewGuid(), new TestsSerializer(), typeof(Target), null, null);

            SpecificationExtensions.ShouldBeNull(entity.DetectChange());
        }