Exemplo n.º 1
0
        public void GetIsolateById_ExistingIsolate_AllFieldsAreSet()
        {
            var service = new PubMlstService(GetUrlReturningIsolate, PostUrlReturns404);

            var isolate = service.GetIsolateById(1234);

            isolate.PubMlstId.Should().Be(1234);
            isolate.PorAVr1.Should().Be("5");
            isolate.PorAVr2.Should().Be("2");
            isolate.FetAVr.Should().Be("F3-6");
            isolate.PorB.Should().Be("2-2");
            isolate.Fhbp.Should().Be("1511");
            isolate.Nhba.Should().Be("20");
            isolate.NadA.Should().Be("");
            isolate.PenA.Should().Be("1");
            isolate.GyrA.Should().Be("4");
            isolate.ParC.Should().Be("1");
            isolate.ParE.Should().Be("1");
            isolate.RpoB.Should().Be("4");
            isolate.RplF.Should().Be("1");
            isolate.SequenceType.Should().Be("23");
            isolate.ClonalComplex.Should().Be("ST-23 complex");
            isolate.BexseroReactivity.Should().Be("none");
            isolate.TrumenbaReactivity.Should().Be("cross-reactive");
        }
Exemplo n.º 2
0
        public void GetIsolateByReference_SchemesPropertyNull_OtherValuesAreSet()
        {
            var controller = new PubMlstService(GetUrlReturningIsolateWithoutSchemes, PostUrlReturnsResult);

            var isolate = controller.GetIsolateByReference("DE14505");

            isolate.PubMlstId.Should().Be(93683);
            isolate.PorAVr1.Should().Be("5");
            isolate.PorAVr2.Should().Be("2");
            isolate.FetAVr.Should().Be("F3-6");
            isolate.PorB.Should().Be("2-2");
            isolate.Fhbp.Should().Be("1511");
            isolate.Nhba.Should().Be("20");
            isolate.NadA.Should().Be("");
            isolate.PenA.Should().Be("1");
            isolate.GyrA.Should().Be("4");
            isolate.ParC.Should().Be("1");
            isolate.ParE.Should().Be("1");
            isolate.RpoB.Should().Be("4");
            isolate.RplF.Should().Be("1");
            isolate.PorAVr1.Should().Be("5");
            isolate.PorAVr2.Should().Be("2");
            isolate.SequenceType.Should().BeNull();
            isolate.ClonalComplex.Should().BeNull();
            isolate.BexseroReactivity.Should().BeNull();
            isolate.TrumenbaReactivity.Should().BeNull();
        }
Exemplo n.º 3
0
        public void GetIsolateByReference_InexistingIsolate_ReturnsNull()
        {
            var controller = new PubMlstService(GetUrlReturns404, PostUrlReturns404);

            var isolate = controller.GetIsolateByReference("DE14");

            isolate.Should().BeNull();
        }
Exemplo n.º 4
0
        public void GetIsolateByReference_InexistingIsolateWithoutMock_ReturnsNull()
        {
            var controller = new PubMlstService();

            var isolate = controller.GetIsolateByReference("DE14");

            isolate.Should().BeNull();
        }
Exemplo n.º 5
0
        public void NeisseriaIsolates_InexisingIsolate_ReturnsEmptyResult()
        {
            var service = new PubMlstService(GetUrlReturns404, PostUrlReturns404);

            var isolate = service.GetIsolateById(0);

            isolate.Should().BeNull();
        }
Exemplo n.º 6
0
        public void GetIsolateByReference_ExistingIsolateWithoutMock_FieldsAreSet()
        {
            var controller = new PubMlstService();

            var isolate = controller.GetIsolateByReference("DE14692");

            isolate.PorAVr1.Should().Be("7-1");
            isolate.PorAVr2.Should().Be("1");
            isolate.SequenceType.Should().BeNull();
            isolate.ClonalComplex.Should().BeNull();
        }
Exemplo n.º 7
0
        public void GetIsolateById_ExistingIsolateWithoutMock_FieldsAreSet()
        {
            var controller = new PubMlstService();

            var isolate = controller.GetIsolateById(93683);

            isolate.PorAVr1.Should().Be("5-1");
            isolate.PorAVr2.Should().Be("10-1");
            isolate.SequenceType.Should().Be("11");
            isolate.ClonalComplex.Should().Be("ST-11 complex");
        }
Exemplo n.º 8
0
        public void GetIsolateByReference_ExistingIsolate_FieldsAreSet()
        {
            var controller = new PubMlstService(GetUrlReturningIsolate, PostUrlReturnsResult);

            var isolate = controller.GetIsolateByReference("DE14505");

            isolate.PubMlstId.Should().Be(93683);
            isolate.PorAVr1.Should().Be("5");
            isolate.PorAVr2.Should().Be("2");
            isolate.SequenceType.Should().Be("23");
            isolate.ClonalComplex.Should().Be("ST-23 complex");
        }
Exemplo n.º 9
0
        public void GetIsolateByReference_FieldsPropertyNull_OtherValuesAreSet()
        {
            var controller = new PubMlstService(GetUrlReturningIsolateWithoutFields, PostUrlReturnsResult);

            var isolate = controller.GetIsolateByReference("DE14505");

            isolate.PubMlstId.Should().Be(93683);
            isolate.PorAVr1.Should().Be("5");
            isolate.PorAVr2.Should().Be("2");
            isolate.SequenceType.Should().BeNull();
            isolate.ClonalComplex.Should().BeNull();
            isolate.BexseroReactivity.Should().BeNull();
            isolate.TrumenbaReactivity.Should().BeNull();
        }
Exemplo n.º 10
0
        public void Setup()
        {
            _database = new ApplicationDbContextMock();
            MockData.CreateMockData(_database);

            for (int i = 0; i < 5; i++)
            {
                var isolate = MockData.CreateInstance <MeningoIsolate>();
                var sending = MockData.CreateInstance <MeningoSending>();
                sending.SamplingDate            = i == 3 ? null : (DateTime?)_firstDayMorning.AddDays(i).AddHours(8);
                sending.ReceivingDate           = _firstDayMorning.AddDays(i).AddHours(8);
                isolate.Sending                 = sending;
                isolate.StemNumber              = i == 4 ? null : (int?)i + 1;
                isolate.NeisseriaPubMlstIsolate = null;
                _database.MeningoIsolates.Add(isolate);
            }

            _pubMlstService = Substitute.For <PubMlstService>();
        }
Exemplo n.º 11
0
 public PubMlstMatcher(IApplicationDbContext db, PubMlstService pubMlstService)
 {
     _db             = db;
     _pubMlstService = pubMlstService;
 }