public void WhereLike_WithoutCache_AddsConditionToRequest() { // Arrange var requestFactory = new DicomRequestFactoryFake(); var mockProvider = new MockProvider(); IDicomQuery<TestInfo> dicomQuery = new DicomQuery<TestInfo>(mockProvider.GetGeneralizedInfoProviderFake(), mockProvider.GetDicomDataLoaderFake(), mockProvider.GetWhereCollectionFake()); // Act dicomQuery = dicomQuery.WhereLike(DicomTags.PatientID, 1); dicomQuery.ToList(); var whereItem = ((IWhereCollection<TestInfo>)requestFactory.WhereCollection).Single(); // Assert Assert.That(whereItem.DicomTag, Is.EqualTo(DicomTags.PatientID)); Assert.That(whereItem.Value, Is.EqualTo(1)); Assert.That(whereItem.Operator, Is.EqualTo(WhereOperator.Like)); }
public void WhereLike_WithCache_FilterInMemoryList() { // Arrange var mockProvider = new MockProvider(); IDicomQuery<TestInfo> dicomQuery = new DicomQuery<TestInfo>(mockProvider.GetGeneralizedInfoProviderFake(), mockProvider.GetDicomDataLoaderFake(), mockProvider.GetWhereCollectionFake()); // Act dicomQuery = dicomQuery.WhereLike(DicomTags.PatientID, 1); var result = dicomQuery.ToList().Select(info => info.PatientID).ToList(); // Assert Assert.That(result.Count, Is.EqualTo(2)); Assert.That(result.Contains(1), Is.True); Assert.That(result.Contains(10), Is.True); }
public void WhereEquals_WithCache_FilterInMemoryList() { // Arrange var mockProvider = new MockProvider(); IDicomQuery<TestInfo> dicomQuery = new DicomQuery<TestInfo>(mockProvider.GetGeneralizedInfoProviderFake(), mockProvider.GetDicomDataLoaderFake(), mockProvider.GetWhereCollectionFake()); // Act dicomQuery = dicomQuery.WhereEquals(DicomTags.PatientID, 1); var result = dicomQuery.ToList().Single(); // Assert Assert.That(result.PatientID, Is.EqualTo(1)); }