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()); }
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 () ); }
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); }
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 ); }
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()); }
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 () ); }