示例#1
0
        public void Transform_should_deserialize_mockaroo_data_into_a_simple_object()
        {
            // Arrange
            var sut = new ClrDataAdapter();
            var data = File.ReadAllBytes(Data.GetFile(KnownFile.BasicResponse).FullName);

            // Act
            var result = sut.Transform<SimpleObject>(data).First();

            // Assert
            Assert.AreEqual(8184, result.DateValue.Year);
            Assert.AreEqual(DayOfWeek.Tuesday, result.Day);
            Assert.AreEqual("velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat", result.StringValue);
        }
示例#2
0
        public void Transform_should_deserialize_mockaroo_data_into_a_complex_object()
        {
            // Arrange
            var sut = new ClrDataAdapter();
            var data = File.ReadAllBytes(Data.GetFile(KnownFile.VeryComplexResponse).FullName);

            // Act
            var result = sut.Transform<ComplexObject>(data).First();

            // Assert
            Assert.AreEqual(676558325, result.IntegerValue);
            Assert.AreEqual(5, result.IntArray.Length);
            Assert.IsNotNull(result.MultiLvl);
            Assert.IsNotNull(result.Nested1);
            Assert.IsNotNull(result.Points);
        }