Exemple #1
0
        public async Task WHEN_all_Supervisors_are_requested_THEN_all_Supervisors_are_returned()
        {
            // arrange

            var s1 = new Supervisor
            {
                SupervisorId = 1000,
                Park         = new Park {
                    ParkId = 2000
                },
                ParkRef         = 2000,
                FirstName       = "Bob",
                LastName        = "Frank",
                Salary          = 10000,
                StartingDate    = DateTime.MinValue,
                Office          = "Near park 2000",
                EmergencyNumber = "07000000000"
            };
            var s2 = new Supervisor
            {
                SupervisorId = 1001,
                Park         = new Park {
                    ParkId = 2001
                },
                ParkRef         = 2001,
                FirstName       = "Manfred",
                LastName        = "Alblot",
                Salary          = 20000,
                StartingDate    = DateTime.MinValue.AddDays(1),
                Office          = "Near park 2001",
                EmergencyNumber = "07000000001"
            };
            var s3 = new Supervisor
            {
                SupervisorId = 999,
                Park         = new Park {
                    ParkId = 1999
                },
                ParkRef         = 1999,
                FirstName       = "Manfred",
                LastName        = "Alblot",
                Salary          = 20000,
                StartingDate    = DateTime.MinValue.AddDays(1),
                Office          = "Near park 2001",
                EmergencyNumber = "07000000001"
            };

            _repository.Add(s1);
            _repository.Add(s2);
            await _repository.SaveChangesAsync();

            // act

            var result = await _repository.GetAllSupervisorsAsync();

            // assert

            Assert.NotEmpty(result);
            Assert.Contains(s1, result);
            Assert.Contains(s2, result);
            Assert.DoesNotContain(s3, result);
        }