Beispiel #1
0
 public void Valid_item_and_valid_IfNoneMatch_delete()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty);
     TestItem.Delete(StreamingCondition.IfNoneMatch("random"));
     TestItem.GetInfo().ShouldFail();
 }
        public void Valid_item_and_failed_IfMatch_throws_condition_failed()
        {
            TestContainer.Create();
            Write(TestItem, Guid.Empty);

            ExpectConditionFailed(() => TryToRead(TestItem, StreamingCondition.IfMatch("asd")));
        }
        public void Valid_item_and_valid_IfNoneMatch_exact_return()
        {
            TestContainer.Create();
            var g = Guid.NewGuid();

            Write(TestItem, g);
            ShouldHaveGuid(TestItem, g, StreamingCondition.IfNoneMatch("none"));
        }
        public void Valid_item_returns()
        {
            TestContainer.Create();
            var g = Guid.NewGuid();

            Write(TestItem, g);
            ShouldHaveGuid(TestItem, g);
        }
        public void Valid_item_and_valid_match_wild_return()
        {
            TestContainer.Create();
            var g = Guid.NewGuid();

            Write(TestItem, g);
            ShouldHaveGuid(TestItem, g, StreamingCondition.IfMatch("*"));
        }
        public void Existing_container_lists_items()
        {
            TestContainer.Create();
            var newGuid = Guid.NewGuid();

            Write(TestItem, newGuid);
            var first = TestContainer.ListItems().First();

            ShouldHaveGuid(TestContainer.GetItem(first), newGuid);
        }
        public void Valid_item_and_valid_IfMatch_exact_return()
        {
            TestContainer.Create();
            var g = Guid.NewGuid();

            Write(TestItem, g);

            var tag = TestItem.GetInfo().Value.ETag;

            ShouldHaveGuid(TestItem, g, StreamingCondition.IfMatch(tag));
        }
Beispiel #8
0
        public void Writing_less_shrunk_data()
        {
            TestContainer.Create();
            var bytes = new byte[100];

            Write(TestItem, bytes);
            ShouldHaveBytes(TestItem, bytes);

            bytes = new byte[2];
            Write(TestItem, bytes);
            ShouldHaveBytes(TestItem, bytes);
        }
        public void Test()
        {
            TestContainer.Create();

            var source = GetItem("source");
            var target = GetItem("target");

            Write(source, Guid.Empty);

            source.ReadInto(s => target.Write(s.CopyTo));

            ShouldHaveGuid(target, Guid.Empty);
        }
        public void Test()
        {
            TestContainer.Create();

            var source = GetItem("source");
            var target = GetItem("target");

            Write(source, Guid.Empty);

            target.CopyFrom(source);

            ShouldHaveGuid(target, Guid.Empty);
        }
 public void Valid_item_and_failed_IfMatch_returns_empty()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty);
     TestItem.GetInfo(StreamingCondition.IfMatch("mismatch")).ShouldFail();
 }
 public void Missing_item_returns_empty()
 {
     TestContainer.Create();
     TestItem.GetInfo().ShouldFail();
 }
 public void Missing_item_works()
 {
     TestContainer.Create();
     TestItem.Delete();
 }
 public void Existing_empty_container_returns_empty()
 {
     TestContainer.Create();
     CollectionAssert.IsEmpty(TestContainer.ListItems());
 }
Beispiel #15
0
 public void Unconditional_upsert_works()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty);
     Write(TestItem, Guid.Empty);
 }
Beispiel #16
0
 public void Conditional_append_works()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty, StreamingCondition.IfNoneMatch("tag"));
 }
Beispiel #17
0
        public void Failed_IfMatch_throws_condition_failed()
        {
            TestContainer.Create();

            ExpectConditionFailed(() => Write(TestItem, Guid.Empty, StreamingCondition.IfMatch("tag")));
        }
Beispiel #18
0
 public void Missing_item_and_valid_IfNoneMatch_succeed()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty, StreamingCondition.IfNoneMatch("none"));
     ShouldHaveGuid(TestItem, Guid.Empty);
 }
Beispiel #19
0
 public void Missing_item_and_failed_IfMatch_throw_condition_failed()
 {
     TestContainer.Create();
     ExpectConditionFailed(() => Write(TestItem, Guid.Empty, StreamingCondition.IfMatch("none")));
 }
 public void Valid_item_returns_info()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty);
     Assert.IsTrue(TestItem.Exists());
 }
 public void Valid_item_returns_info()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty);
     TestItem.GetInfo().ShouldPass();
 }
Beispiel #22
0
 public void Missing_item_and_failed_IfMatch_work()
 {
     TestContainer.Create();
     TestItem.Delete(StreamingCondition.IfMatch("some"));
 }
        public void Missing_item_throws_item_not_found()
        {
            TestContainer.Create();

            ExpectItemNotFound(() => TryToRead(TestItem));
        }
 public void Missing_item_and_IfMatch_throw_item_not_found()
 {
     TestContainer.Create();
     ExpectItemNotFound(() => TryToRead(TestItem, StreamingCondition.IfMatch("mismatch")));
 }
 public void Valid_item_and_valid_IfNoneMatch_returns_info()
 {
     TestContainer.Create();
     Write(TestItem, Guid.Empty);
     TestItem.GetInfo(StreamingCondition.IfNoneMatch("never")).ShouldPass();
 }
 public void Missing_item_returns_empty()
 {
     TestContainer.Create();
     Assert.IsFalse(TestItem.Exists());
 }