예제 #1
0
        public void GetMethod_IdNotExist()
        {
            ProcessorController controller = new ProcessorController(_uploadImageServiceMock.Object, _processorMock.Object);
            var result = controller.Get("1-2-3");

            Assert.IsInstanceOfType(result, typeof(BadRequestErrorMessageResult));
        }
예제 #2
0
        public void GetMethod_IdExist()
        {
            var status = new ProcessStatusInfo();

            status.SetProgress(1);
            status.SetStatus(ProcessStatusEnum.Done);
            _processorMock.Add("1-2-4", status);

            ProcessorController controller = new ProcessorController(_uploadImageServiceMock.Object, _processorMock.Object);
            var result = controller.Get("1-2-4");

            Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <ProcessStatusInfoBase>));
            ProcessStatusInfoBase value = ((OkNegotiatedContentResult <ProcessStatusInfoBase>)result).Content;

            Assert.AreEqual(1, value.Progress);
            Assert.AreEqual(ProcessStatusEnum.Done, value.Status);
        }