예제 #1
0
        public void FindMetadata_SearchStringIsResourceNameLayerNameIsInvalid_ReturnedEmpty()
        {
            var documentSessionProvider = new DocumentSessionProvider(Store);
            var repository = new MetadataRepository(documentSessionProvider, new FakeMetadataMerger());

            var metadataList = repository.FindMetadata(ResourceName1, "Not Existed Layer");

            Assert.AreEqual(0, metadataList.Count());
        }
예제 #2
0
        public void FindMetadata_SearchStringIsResourceNameLayerNameIsInvalid_ReturnedEmpty()
        {
            var documentSessionProvider = new DocumentSessionProvider ( Store );
            var repository = new MetadataRepository ( documentSessionProvider, new FakeMetadataMerger () );

            var metadataList = repository.FindMetadata ( ResourceName1, "Not Existed Layer" );

            Assert.AreEqual ( 0, metadataList.Count () );
        }
예제 #3
0
        public void FindMetadata_SearchStringIsResourceNameLayerNameIsValid_ReturnedOneMetadata()
        {
            var documentSessionProvider = new DocumentSessionProvider(Store);
            var repository = new MetadataRepository(documentSessionProvider, new FakeMetadataMerger());

            var metadataList = repository.FindMetadata(ResourceName1, LayerName1);

            Assert.AreEqual(1, metadataList.Count());
            Assert.AreEqual(ResourceName1, metadataList.First().ResourceName);
        }
예제 #4
0
        public void FindMetadata_SearchStringIsResourceName_ReturnedOneMetadata()
        {
            var documentSessionProvider = new DocumentSessionProvider ( Store );
            var repository = new MetadataRepository ( documentSessionProvider, new FakeMetadataMerger () );

            var metadataList = repository.FindMetadata ( ResourceName1 );

            Assert.AreEqual ( 1, metadataList.Count () );
            Assert.AreEqual ( ResourceName1, metadataList.First ().ResourceName );
        }
예제 #5
0
        public void FindMetadata_SearchStringIsWildchardResourceName_ReturnedTwoMetadata()
        {
            var documentSessionProvider = new DocumentSessionProvider(Store);
            var repository = new MetadataRepository(documentSessionProvider, new FakeMetadataMerger());

            var metadataList = repository.FindMetadata("PatientModule.Web.PatientDto.*");

            Assert.AreEqual(2, metadataList.Count());
            Assert.AreEqual(1, metadataList.Where(x => x.ResourceName == ResourceName1).Count());
            Assert.AreEqual(1, metadataList.Where(x => x.ResourceName == ResourceName2).Count());
        }
예제 #6
0
        public void FindMetadata_SearchStringIsWildchardResourceName_ReturnedTwoMetadata()
        {
            var documentSessionProvider = new DocumentSessionProvider ( Store );
            var repository = new MetadataRepository ( documentSessionProvider, new FakeMetadataMerger () );

            var metadataList = repository.FindMetadata ( "PatientModule.Web.PatientDto.*" );

            Assert.AreEqual ( 2, metadataList.Count () );
            Assert.AreEqual ( 1, metadataList.Where ( x => x.ResourceName == ResourceName1 ).Count () );
            Assert.AreEqual ( 1, metadataList.Where ( x => x.ResourceName == ResourceName2 ).Count () );
        }