public void ExecutePost(PostProcessImageRequest request) { Base64DecodedData base64Decoded = _processImageDecoder.DecodeBase64ImageString(request.base64Image); ProcessImageData imageData = ImageDataFactory.CreateImageDataObject(request, base64Decoded); _processImageGateway.UploadImage(imageData); }
public void given_a_request_and_decodedBase64Data_objects_when_CreateImageDataObject_factory_method_is_called_then_it_outputs_correctly_populated_ProcessImageData_object() { //arrange var request = MatProcessDataHelper.CreatePostProcessImageRequestObject(); var decodedData = MatProcessDataHelper.CreateBase64DecodedDataObject(); //act var processImageData = ImageDataFactory.CreateImageDataObject(request, decodedData); //asssert Assert.AreEqual(request.processRef, processImageData.processRef); Assert.AreEqual(request.imageId, processImageData.imageId); Assert.AreEqual(decodedData.imageType, processImageData.imageData.imageType); Assert.AreEqual(decodedData.imageExtension, processImageData.imageData.imageExtension); Assert.True(decodedData.imagebase64String.SequenceEqual(processImageData.imageData.imagebase64String)); }