Пример #1
0
        public async Task WHEN_repository_is_queried_by_parkName_THEN_park_with_parkName_is_returned()
        {
            // arrange

            var p1 = new Park
            {
                ParkId = 1021,
                Name   = "Park21 Test",
                SizeInMetresSquared = 1010,
                Longitude           = 1.00m,
                Latitude            = -1.00m,
                OpeningTime         = DateTime.MinValue,
                ClosingTime         = DateTime.MaxValue,
                Supervisor          = new Supervisor()
            };

            _repository.Add(p1);
            await _repository.SaveChangesAsync();

            // act

            var result1 = await _repository.GetParkByNameAsync("Park21 Test");

            var result2 = await _repository.GetParkByNameAsync("nothing");

            // assert

            Assert.NotNull(result1);
            Assert.Null(result2);
            Assert.Equal(p1.Name, result1.Name);
            Assert.NotEqual(result1, result2);
        }