public async Task ReferenceController_CreateTest()
        {
            var repository = new Repository();

            var _controller = new ReferenceController(repository, new PrintServerBridge(), new EventHub())
            {
                Configuration = Helper.CreateHttpConfiguration(),
                Request       = new HttpRequestMessage()
            };

            var response = await(await _controller.Create(GetCreateReferenceRequest())).ExecuteAsync(new CancellationToken());

            Assert.AreEqual(response.StatusCode, HttpStatusCode.Created);

            CreateReferenceResponse result = null;

            response.TryGetContentValue(out result);

            Assert.IsNotNull(result);
            Assert.IsFalse(string.IsNullOrEmpty(result.Number));
        }
        public async Task ReferenceController_Create_BadPSTest()
        {
            var repository = new Repository();

            var _controller = new ReferenceController(repository, new BadPrintServerBridge(), new EventHub())
            {
                Configuration = Helper.CreateHttpConfiguration(),
                Request       = new HttpRequestMessage()
            };

            var response = await(await _controller.Create(GetCreateReferenceRequest())).ExecuteAsync(new CancellationToken());

            Assert.AreEqual(response.StatusCode, HttpStatusCode.InternalServerError);
            Assert.AreEqual(repository.References["1"].Status, Constants.ReferenceStatusPdfError);

            AdditionalInformation result = null;

            response.TryGetContentValue(out result);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Errors);
            Assert.IsTrue(result.Errors.Where(p => p.Code == "100").Any());
        }