コード例 #1
0
        public void ToExerciseListVm_maps_AllExercises()
        {
            var exercises = new List <Exercise> {
                new Exercise("jooks", 1, "comment")
                {
                    Id = 12
                }, new Exercise("hype", 1)
            };
            var sut = new ExerciseMapper();

            // Act
            var result = sut.ToExerciseListVm(exercises);

            // Assert
            Assert.That(result.Count(), Is.EqualTo(2));
        }
コード例 #2
0
        public void ToExerciseListVm_maps_Comment()
        {
            var exercises = new List <Exercise> {
                new Exercise("jooks", 1, "comment")
                {
                    Id = 12
                }
            };
            var sut = new ExerciseMapper();

            // Act
            var result = sut.ToExerciseListVm(exercises);

            // Assert
            Assert.That(result.FirstOrDefault().Comment, Is.EqualTo("comment"));
        }