Example #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());
        }
Example #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();
        }
Example #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();
        }
Example #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());
        }
Example #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));
        }
Example #6
0
        public void detect_changes_with_no_document()
        {
            var entity = new TrackedEntity(Guid.NewGuid(), new JilSerializer(), typeof(Target), null);

            entity.DetectChange().ShouldBeNull();
        }
Example #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());
        }