Beispiel #1
0
        public void MapGoalModelToGoal_WhenGoalEmpty_ShouldReturnEmpty(
            GoalMapper sut)
        {
            // Act
            var result = sut.Map(new GoalModel());

            // Asserts
            result.Should().BeOfType <Goal>();
            result.Title.Should().BeNull();
            result.Count.Should().Be(default);
Beispiel #2
0
        public void MapGoalListToGoalModelList_WhenListNull_ShouldReturnEmpty(
            GoalMapper sut)
        {
            // Arrange
            List <Goal> goals = null;

            // Act
            var result = sut.Map(goals);

            // Assert
            result.Should().BeEmpty();
        }
Beispiel #3
0
        public void MapGoalModelToGoal_ShouldMapCorrectly(
            GoalModel goalModel,
            GoalMapper sut)
        {
            // Act
            var result = sut.Map(goalModel);

            // Asserts
            result.Should().BeOfType <Goal>();
            result.Should().BeEquivalentTo(goalModel,
                                           opt => opt.Excluding(src => src.Id));
        }
Beispiel #4
0
        public void MapGoalListToGoalModelList_WhenListFilled_ShouldMapCorrectly(
            List <Goal> goals,
            GoalMapper sut)
        {
            // Act
            var result = sut.Map(goals);

            // Assert
            result.Should().NotBeNullOrEmpty();
            result.Should().BeOfType <List <GoalModel> >();
            result.Should().BeEquivalentTo(goals,
                                           opt => opt.Excluding(src => src.Id));
        }