Exemple #1
0
        public void ExerciseMapping_ModelToDtoAllFieldsWithValues_Valid()
        {
            //Arrange
            _model        = new Exercise();
            _model.Id     = 100;
            _model.Muscle = new Muscle {
                Id = 342, Name = "Bicep"
            };
            _model.Name = "Pushup";
            _model.WorkoutSessionExercices = new Collection <WorkoutSessionExercise> {
                new WorkoutSessionExercise(), new WorkoutSessionExercise()
            };


            //Act
            _dto = _mapper.GetDto(_model);

            //Assert
            Assert.AreEqual(_model.Id, _dto.UniqueIdentifier);
            Assert.AreEqual(_model.Muscle.Id, _dto.MuscleUniqueIdentifier);
            Assert.AreEqual(_model.Name.English, _dto.EnglishName);
            Assert.AreEqual(_model.Name.French, _dto.FrenchName);
            Assert.AreEqual(_model.Muscle.Name.English, _dto.MuscleEnglishName);
            Assert.AreEqual(_model.Muscle.Name.French, _dto.MuscleFrenchName);
        }
Exemple #2
0
        public void ExerciseMapping_ModelToDtoDefaultValue_Valid()
        {
            //Arrange
            _model = new Exercise();

            //Act
            _dto = _mapper.GetDto(_model);

            //Assert
            Assert.AreEqual(_model.Id, _dto.UniqueIdentifier);
            Assert.AreEqual(default(string), _dto.MuscleEnglishName);
            Assert.AreEqual(default(string), _dto.MuscleFrenchName);
            Assert.AreEqual(default(int), _dto.MuscleUniqueIdentifier);
            Assert.AreEqual(default(string), _dto.EnglishName);
            Assert.AreEqual(default(string), _dto.FrenchName);
        }