public void Test_BlankPatientIdentifier(Test testCase) { var db = GetCleanedServer(DatabaseType.MicrosoftSQLServer); //the declaration of what the guid namer table should be var options = new IdentifierMapperOptions(); options.MappingConnectionString = db.Server.Builder.ConnectionString; var swapper = new SwapForFixedValueTester("meeee"); swapper.Setup(options); var consumer = new IdentifierMapperQueueConsumer(Mock.Of <IProducerModel>(), swapper); var msg = GetTestDicomFileMessage(testCase: testCase); string reason; Assert.False(consumer.SwapIdentifier(msg, out reason)); switch (testCase) { case Test.EmptyInPatientTag: Assert.AreEqual("PatientID was blank", reason); break; case Test.NoPatientTag: Assert.AreEqual("Dataset did not contain PatientID", reason); break; } }
public void Test_NoMatchingIdentifierFound() { var db = GetCleanedServer(DatabaseType.MicrosoftSQLServer); //the declaration of what the guid namer table should be var options = new IdentifierMapperOptions(); options.MappingConnectionString = db.Server.Builder.ConnectionString; //null here means it will never find any identifier var swapper = new SwapForFixedValueTester(null); swapper.Setup(options); var consumer = new IdentifierMapperQueueConsumer(Mock.Of <IProducerModel>(), swapper); var msg = GetTestDicomFileMessage(); string reason; Assert.False(consumer.SwapIdentifier(msg, out reason)); Assert.AreEqual("Swapper Microservices.IdentifierMapper.Tests.SwapForFixedValueTester returned null", reason); }