コード例 #1
0
        public void TaskDataDeserealizeTest()
        {
            //Arrange
            var deserializer = new Mock<IDeserializer>();
            var response = new Mock<IRestResponse>();
            var encodeDeserializer = new EncodeDeserializer(deserializer.Object);

            var data = new EncodeTaskData();

            deserializer.Setup(m => m.Deserialize<EncodeTaskData>(response.Object)).Returns(data);

            //Act 
            var encodeTaskData = encodeDeserializer.EncodeTaskDataDeserealize(response.Object);

            //Assert
            Assert.AreEqual(data, encodeTaskData);
        }
コード例 #2
0
        public void ScreenshotDataDeserializeTest()
        {
            //Arrange
            const TypeOfTask typeOfType = TypeOfTask.Screenshot;

            var deserializer = new Mock<IDeserializer>();
            var response = new Mock<IRestResponse>();
            var encodeDeserializer = new EncodeDeserializer(deserializer.Object);

            var data = new ScreenshotEncodeData();

            deserializer.Setup(m => m.Deserialize<ScreenshotEncodeData>(response.Object)).Returns(data);

            //Act 
            var encodeData = encodeDeserializer.EncodeDataDeserialize(response.Object, typeOfType);

            //Assert
            Assert.AreEqual(data,encodeData);
        }