예제 #1
0
        public async Task GetNonExistentCourseShouldReturnNull()
        {
            //Arrange
            var fixture = new CourseRepositoryFixture()
                          .WithXCourses(1);

            //Act
            var result = await fixture.ExecuteGet(new Course()
            {
                Code = "C2"
            });

            //Assert
            Assert.Null(result);
        }
예제 #2
0
        public async Task GetExistingCourseShouldReturnCourse()
        {
            //Arrange
            var fixture = new CourseRepositoryFixture()
                          .WithXCourses(1);
            Course expected = new Course()
            {
                CourseId = 1, Code = "C1", LengthInDays = 5, Title = "Course1"
            };

            //Act
            var result = await fixture.ExecuteGet(new Course()
            {
                Code = "C1"
            });

            //Assert
            expected.Should().BeEquivalentTo(result);
        }