コード例 #1
0
        public void JobJobProgressResponseFromJson()
        {
            JobProgressResponse response = JobProgressResponse.FromJson(@"{""state"":""processing"",""current_event"":""Transcoding"",""progress"":""32.34567345""}");

            Assert.AreEqual(OutputState.Processing, response.State);
            Assert.AreEqual(OutputEvent.Transcoding, response.CurrentEvent);
            Assert.AreEqual(32.34567345, response.Progress);
        }
コード例 #2
0
        public void JobJobProgressResponseFromJson()
        {
            JobProgressResponse response = JobProgressResponse.FromJson(@"{
                                                                      ""state"": ""processing"",
                                                                      ""progress"": 32.34567345,
                                                                      ""input"": {
                                                                        ""id"": 1234,
                                                                        ""state"": ""finished""
                                                                      },
                                                                      ""outputs"": [
                                                                        {
                                                                          ""id"": 4567,
                                                                          ""state"": ""processing"",
                                                                          ""current_event"": ""Transcoding"",
                                                                          ""current_event_progress"": 25.0323,
                                                                          ""progress"": 35.23532
                                                                        },
                                                                        {
                                                                          ""id"": 4568,
                                                                          ""state"": ""processing"",
                                                                          ""current_event"": ""Uploading"",
                                                                          ""current_event_progress"": 82.32,
                                                                          ""progress"": 95.3223
                                                                        }
                                                                      ]
                                                                    }");

            Assert.AreEqual(OutputState.Processing, response.State);
            Assert.AreEqual(32.34567345, response.Progress);

            Assert.AreEqual(1234, response.Input.Id);
            Assert.AreEqual(OutputState.Finished, response.Input.State);

            Assert.AreEqual(2, response.Outputs.Length);
            Assert.AreEqual(4567, response.Outputs[0].Id);
            Assert.AreEqual(OutputState.Processing, response.Outputs[0].State);
            Assert.AreEqual(OutputEvent.Transcoding, response.Outputs[0].CurrentEvent);
            Assert.AreEqual(25.0323, response.Outputs[0].CurrentEventProgress);
            Assert.AreEqual(35.23532, response.Outputs[0].Progress);
        }