Ejemplo n.º 1
0
        public void Invalid_NullModel()
        {
            var controller = new FhirBaseControllerStub();

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = HttpContexts.Valid_CustomHeaders;

            Assert.Throws <HttpFhirException>(() => controller.SetHeadersTest(null));
        }
Ejemplo n.º 2
0
        public void Valid_WithHeaders()
        {
            var controller = new FhirBaseControllerStub();

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = HttpContexts.Valid_CustomHeaders;

            var resource = new RequestViewModel
            {
                Id = "test"
            };

            var result = controller.SetHeadersTest(resource);

            Assert.Equal("test", result.Id);
            Assert.Equal("000", result.Asid);
            Assert.Equal("org001", result.OrgCode);
        }
Ejemplo n.º 3
0
        public void Valid_NoHeaders()
        {
            var controller = new FhirBaseControllerStub();

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = HttpContexts.Valid_Search;

            var resource = new RequestViewModel
            {
                Id = "test"
            };

            var result = controller.SetHeadersTest(resource);

            Assert.Equal("test", result.Id);
            Assert.Null(result.OrgCode);
            Assert.Null(result.Asid);
        }