public void When_object_doesnt_exist_return_null()
        {
            var collection = new StreamCollection(_name);

            // Act
            var result = collection.GetById <StreamCollectionFixture>(AutoFixture.Create <string>());

            // Assert
            result.Should().BeNull();
        }
        public void When_object_does_exist_but_generic_is_not_of_type_thow()
        {
            var fixture    = AutoFixture.Create <StreamCollectionFixture>();
            var collection = new StreamCollection(_name);

            collection.Added(fixture.Id, JObject.FromObject(fixture));

            // Act
            Action action = () => collection.GetById <string>(fixture.Id);

            // Assert
            action.ShouldThrow <ArgumentException>();
        }
        public void When_object_does_exist_return_object()
        {
            var fixture    = AutoFixture.Create <StreamCollectionFixture>();
            var collection = new StreamCollection(_name);

            collection.Added(fixture.Id, JObject.FromObject(fixture));

            // Act
            var result = collection.GetById <StreamCollectionFixture>(fixture.Id);

            // Assert
            result.Should().Be(fixture);
        }
        public void When_object_does_exist_but_generic_is_not_of_type_thow()
        {
            var fixture = AutoFixture.Create<StreamCollectionFixture>();
            var collection = new StreamCollection(_name);
            collection.Added(fixture.Id, JObject.FromObject(fixture));

            // Act
            Action action = () => collection.GetById<string>(fixture.Id);

            // Assert
            action.ShouldThrow<ArgumentException>();
        }
        public void When_object_does_exist_return_object()
        {
            var fixture = AutoFixture.Create<StreamCollectionFixture>();
            var collection = new StreamCollection(_name);
            collection.Added(fixture.Id, JObject.FromObject(fixture));

            // Act
            var result = collection.GetById<StreamCollectionFixture>(fixture.Id);

            // Assert
            result.Should().Be(fixture);
        }
        public void When_object_doesnt_exist_return_null()
        {
            var collection = new StreamCollection(_name);

            // Act
            var result = collection.GetById<StreamCollectionFixture>(AutoFixture.Create<string>());

            // Assert
            result.Should().BeNull();
        }