public void ShouldReturnSpecialStudent()
    {
        // Arrange (Given)
        A.CallTo(() => _studentRepository.GetAllStudents()).Returns(
            new List <Students> {
            new Students {
                StudentId = 80,
                Email     = "*****@*****.**"
            },
            new Students {
                StudentId = 52,
                Email     = "*****@*****.**"
            }
        }
            );

        // Assert (NUnit Assertions) (Then)
        Assert.That(_studentService.GetAllStudents().Any(student => student.Special), Is.EqualTo(true));

        // Assert (FluentAssertions) (Then)
        _studentService.GetAllStudents().Any(student => student.Special).Should().BeTrue();
    }
Example #2
0
 public async Task <ActionResult <List <Student> > > GetAllStudents()
 {
     return(await studentServices.GetAllStudents());
 }