public void GivenAnEmailRequest_WhenNotValidBase64Data_ReturnsIsValidFalse()
        {
            var sut = new StorageRequest
            {
                Base64Data    = "-- InValid Base 64 Data --",
                ContentType   = "Application/Json",
                ContainerName = "Container Name"
            };

            Assert.IsFalse(sut.IsValid());
        }
        public async Task <StorageResponseDTO> Execute(StorageRequestDTO requestDTO)
        {
            var request = new StorageRequest
            {
                Base64Data    = requestDTO.Base64Data,
                ContentType   = requestDTO.ContentType,
                ContainerName = requestDTO.ContainerName
            };

            if (!request.IsValid())
            {
                throw new BadRequestException();
            }

            return(await _mediator.Send(request));
        }
        public void GivenAnEmailRequest_WhenValid_ReturnsIsValidTrue()
        {
            string base64Decoded = "base64 encoded string";
            string base64Encoded;

            byte[] data = System.Text.ASCIIEncoding.ASCII.GetBytes(base64Decoded);
            base64Encoded = System.Convert.ToBase64String(data);

            var sut = new StorageRequest
            {
                Base64Data    = base64Encoded,
                ContentType   = "Application/Json",
                ContainerName = "Container Name"
            };

            Assert.IsTrue(sut.IsValid());
        }