示例#1
0
        public void NeisseriaIsolates_InexisingIsolate_ReturnsNotFound()
        {
            var service    = Substitute.For <PubMlstService>();
            var controller = new PubMlstController(service);

            var isolate = controller.NeisseriaIsolates("ABC");

            isolate.Should().BeOfType <HttpNotFoundResult>();
        }
示例#2
0
        public void NeisseriaIsolates_ExisingIsolate_FieldsAreSet()
        {
            const string isolateReference = "DE1234";
            var          service          = Substitute.For <PubMlstService>();

            service.GetIsolateByReference(isolateReference).Returns(new NeisseriaPubMlstIsolate {
                SequenceType = "22"
            });

            var controller = new PubMlstController(service);

            var json    = new JavaScriptSerializer().Serialize((controller.NeisseriaIsolates(isolateReference) as JsonResult)?.Data);
            var isolate = JsonConvert.DeserializeObject <NeisseriaPubMlstIsolate>(json);

            isolate.SequenceType.Should().Be("22");
        }