Пример #1
0
        public void RunSerializerWithSplit()
        {
            int     length = 200;
            ICourse course = CreateSplitTrainingCourse(length);

            ImprovedNewtonsoftJsonCourseSerializer serializer = new ImprovedNewtonsoftJsonCourseSerializer();

            try
            {
                byte[] data = serializer.CourseToByteArray(course);
                serializer.CourseFromByteArray(data);
            }
            catch (Exception)
            {
                Assert.Fail("failed with a length of: " + length);
            }
        }
Пример #2
0
        public void RunSerializerWithEarlyFinish()
        {
            int     length = 500;
            ICourse course = CreateTrainingCourse(length);

            ImprovedNewtonsoftJsonCourseSerializer serializer = new ImprovedNewtonsoftJsonCourseSerializer();

            try
            {
                Transition t1 = new Transition();
                t1.Data.TargetStep = null;
                course.Data.Chapters[0].Data.Steps.First().Data.Transitions.Data.Transitions.Insert(0, t1);

                byte[] data = serializer.CourseToByteArray(course);
                serializer.CourseFromByteArray(data);
            }
            catch (Exception)
            {
                Assert.Fail("failed with a length of: " + length);
            }
        }