Ejemplo n.º 1
0
        public static bool AreEqual(ReadingProgramInfo expected, ReadingProgramVM actual)
        {
            Assert.NotNull(actual, "Actual was null");
            Assert.AreEqual(expected.Id, actual.ProgramId, "ProgramId didn't match");

            AreEqual(expected.Children, actual.ChildrenIds, AreEqual);

            return(true);
        }
Ejemplo n.º 2
0
        public static ReadingProgramVM ToReadingProgramVM(this ReadingProgramInfo program)
        {
            var vm = new ReadingProgramVM
            {
                ProgramId   = program.Id,
                ChildrenIds = program.Children
            };

            vm.ProgramType = program.ProgramType switch
            {
                ReadingProgramType.SingleWords => Models.ReadingPrograms.ReadingProgramType.SingleWords,
                ReadingProgramType.Couplets => Models.ReadingPrograms.ReadingProgramType.Couplets,
                ReadingProgramType.Sentences => Models.ReadingPrograms.ReadingProgramType.Sentences,
                ReadingProgramType.HomemadeBooks => Models.ReadingPrograms.ReadingProgramType.HomemadeBooks,
                _ => vm.ProgramType
            };

            return(vm);
        }
    }