示例#1
0
            public void ReturnsListForSingleDocument()
            {
                // Given
                IDocument a = Substitute.For<IDocument>();
                InitialMetadata initialMetadata = new InitialMetadata { ["A"] = a };
                Metadata metadata = new Metadata(initialMetadata);

                // When
                IReadOnlyList<IDocument> result = metadata.Documents("A");

                // Then
                Assert.IsNotNull(result);
                CollectionAssert.AreEqual(new[] { a }, result);
            }
示例#2
0
            public void ReturnsNullWhenKeyNotFound()
            {
                // Given
                InitialMetadata initialMetadata = new InitialMetadata();
                Metadata metadata = new Metadata(initialMetadata);

                // When
                IReadOnlyList<IDocument> result = metadata.Documents("A");

                // Then
                Assert.IsNull(result);
            }
示例#3
0
            public void ReturnsEmptyListForSingleInt()
            {
                // Given
                InitialMetadata initialMetadata = new InitialMetadata { ["A"] = 1 };
                Metadata metadata = new Metadata(initialMetadata);

                // When
                IReadOnlyList<IDocument> result = metadata.Documents("A");

                // Then
                Assert.IsNotNull(result);
                CollectionAssert.IsEmpty(result);
            }