public void NoConflict_ETagNull_LastModifiedNull()
        {
            var concurrencyAware  = new DummyConcurrencyAware();
            var concurrencyAware2 = new DummyConcurrencyAware();

            concurrencyAware.AssertNoConflict(concurrencyAware2);
            Assert.False(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
Пример #2
0
        public void NoConflict_ETagNull_LastModifiedNull()
        {
            var concurrencyAware = new DummyConcurrencyAware();
            var concurrencyAware2 = new DummyConcurrencyAware();

            concurrencyAware.AssertNoConflict(concurrencyAware2);
            Assert.False(concurrencyAware.ConflictsWith(concurrencyAware2));

        }
        public void Inconsistent_ETag_LastModified()
        {
            var concurrencyAware = new DummyConcurrencyAware()
            {
                ETag = "12345"
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                LastModofied = DateTimeOffset.Now
            };

            Assert.Throws <InvalidOperationException>(() => concurrencyAware.AssertNoConflict(concurrencyAware2));
            Assert.Throws <InvalidOperationException>(() => concurrencyAware.ConflictsWith(concurrencyAware2));
        }
        public void Conflict_ETagDifferent_LastModifiedNull()
        {
            var concurrencyAware = new DummyConcurrencyAware()
            {
                ETag = "12345"
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                ETag = "12345x"
            };

            Assert.Throws <ConcurrencyConflictException>(() => concurrencyAware.AssertNoConflict(concurrencyAware2));

            Assert.True(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
Пример #5
0
        public void Conflict_ETagDifferent_LastModifiedNull()
        {
            var concurrencyAware = new DummyConcurrencyAware()
            {
                ETag = "12345"
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                ETag = "12345x"
            };

            Assert.Throws<ConcurrencyConflictException>(() => concurrencyAware.AssertNoConflict(concurrencyAware2));

            Assert.True(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
        public void Conflict_ETagNull_LastModifiedDifferent()
        {
            var lastMod          = DateTimeOffset.Now;
            var concurrencyAware = new DummyConcurrencyAware()
            {
                LastModofied = lastMod
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                LastModofied = lastMod.AddMilliseconds(1)
            };

            Assert.Throws <ConcurrencyConflictException>(() => concurrencyAware.AssertNoConflict(concurrencyAware2));

            Assert.True(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
        public void NoConflict_ETagNull_LastModifiedEqual()
        {
            var lastMod          = DateTimeOffset.Now;
            var concurrencyAware = new DummyConcurrencyAware()
            {
                LastModofied = lastMod
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                LastModofied = lastMod
            };


            concurrencyAware.AssertNoConflict(concurrencyAware2);
            Assert.False(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
Пример #8
0
        public void Conflict_ETagNull_LastModifiedDifferent()
        {
            var lastMod = DateTimeOffset.Now;
            var concurrencyAware = new DummyConcurrencyAware()
            {
                LastModified = lastMod
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                LastModified = lastMod.AddMilliseconds(1)
            };

            Assert.Throws<ConcurrencyConflictException>(() => concurrencyAware.AssertNoConflict(concurrencyAware2));
            
            Assert.True(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
Пример #9
0
        public void NoConflict_ETagNull_LastModifiedEqual()
        {
            var lastMod = DateTimeOffset.Now;
            var concurrencyAware = new DummyConcurrencyAware()
            {
                LastModified = lastMod
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                LastModified = lastMod
            };

            
            concurrencyAware.AssertNoConflict(concurrencyAware2);
            Assert.False(concurrencyAware.ConflictsWith(concurrencyAware2));
        }
Пример #10
0
        public void Inconsistent_ETag_LastModified()
        {
            var concurrencyAware = new DummyConcurrencyAware()
            {
                ETag = "12345"
            };
            var concurrencyAware2 = new DummyConcurrencyAware()
            {
                LastModified = DateTimeOffset.Now
            };

            Assert.Throws<InvalidOperationException>(() => concurrencyAware.AssertNoConflict(concurrencyAware2));
            Assert.Throws<InvalidOperationException>(() => concurrencyAware.ConflictsWith(concurrencyAware2));

        }