Exemplo n.º 1
0
        public void ProcessModelToViewModel_SetsPatientId()
        {
            var sut = new MeningoIsolateViewModelMappingAction();
            var isolateViewModel = new MeningoIsolateViewModel();
            var isolate          = CreateEmptyIsolate();

            isolate.Sending.Patient.PatientId = 123;

            sut.Process(isolate, isolateViewModel);

            isolateViewModel.PatientId.Should().Be(123);
        }
Exemplo n.º 2
0
        public void ProcessViewModelToModel_NoGrowthAtAll_SetFieldMeningoMaterialToNoGrowthExceptForNativeMaterial(MeningoMaterial currentMaterial, MeningoMaterial expectedMaterial)
        {
            var sut = new MeningoIsolateViewModelMappingAction();
            var isolateViewModel = new MeningoIsolateViewModel();
            var isolate          = CreateEmptyIsolate();

            isolate.Sending.Material = currentMaterial;

            sut.Process(isolateViewModel, isolate);

            isolate.Sending.Material.Should().Be(expectedMaterial);
        }
Exemplo n.º 3
0
        public void ProcessModelToViewModel_OtherNonInvasiveSamplingLocation()
        {
            var sut = new MeningoIsolateViewModelMappingAction();
            var isolateViewModel = new MeningoIsolateViewModel();
            var isolate          = CreateEmptyIsolate();

            isolate.Sending.SamplingLocation = MeningoSamplingLocation.OtherNonInvasive;
            isolate.Sending.OtherNonInvasiveSamplingLocation = "Noninvasive Location";

            sut.Process(isolate, isolateViewModel);

            isolateViewModel.SamplingLocation.Should().Be("Noninvasive Location");
        }
Exemplo n.º 4
0
        public void ProcessModelToViewModel_ConvertsEnumValuesToDescription()
        {
            var sut = new MeningoIsolateViewModelMappingAction();
            var isolateViewModel = new MeningoIsolateViewModel();
            var isolate          = CreateEmptyIsolate();

            isolate.Sending.SamplingLocation = MeningoSamplingLocation.BloodAndLiquor;
            isolate.Sending.Material         = MeningoMaterial.IsolatedDna;

            sut.Process(isolate, isolateViewModel);

            isolateViewModel.SamplingLocation.Should().Be("Blut und Liquor");
            isolateViewModel.Material.Should().Be("Isolierte DNA");
            isolateViewModel.Invasive.Should().Be("Ja");
        }
Exemplo n.º 5
0
        public void ProcessModelToViewModel_PopulatesSenderData()
        {
            var sut = new MeningoIsolateViewModelMappingAction();
            var isolateViewModel = new MeningoIsolateViewModel();
            var isolate          = CreateEmptyIsolate();

            DbMock.Senders.Find(1).Name             = "Test Sender";
            DbMock.Senders.Find(1).PostalCode       = "12345";
            DbMock.Senders.Find(1).City             = "The City";
            DbMock.Senders.Find(1).StreetWithNumber = "Long Street 123456";

            sut.Process(isolate, isolateViewModel);

            isolateViewModel.SenderName.Should().Be("Test Sender");
            isolateViewModel.SenderCity.Should().Be("12345 The City");
            isolateViewModel.SenderStreet.Should().Be("Long Street 123456");
        }