Example #1
0
        public void FinishTaskRequestCreateTest()
        {
            //Arrange
            const string       resource     = "resource";
            const string       errorMessage = "errorMessage";
            const string       fileHash     = "fileId";
            const EncoderState encoderState = EncoderState.Completed;


            //Act
            var request = _helper.FinishTaskRequestCreate(resource, encoderState, fileHash, errorMessage);

            //Assert
            Assert.AreEqual(Method.POST, request.Method);
            Assert.AreEqual(resource, request.Resource);
            Assert.IsTrue(request.Parameters.Any(p => p.Type == ParameterType.Cookie && p.Name == _settings.CookieName && (string)p.Value == _settings.CookieValue));
            Assert.IsTrue(request.Parameters.Any(p => p.Name == EncoderStatusParameters.Result && (EncoderState)p.Value == encoderState));
            Assert.IsTrue(request.Parameters.Any(p => p.Name == EncoderStatusParameters.Message && (string)p.Value == errorMessage));
            Assert.IsTrue(request.Parameters.Any(p => p.Name == EncoderStatusParameters.FileHash && (string)p.Value == fileHash));
            Assert.IsTrue(request.Parameters.Any(p => p.Name == "X-HTTP-Method-Override" && (string)p.Value == "DELETE"));
        }