コード例 #1
0
        public async Task Test_DatabaseService_Add_And_Remove_MswSurfspot()
        {
            // Arrange
            var mswSurfSpot = new MswSurfSpot()
            {
                Url = "Msw Test Url", Name = "Msw Test Name", FullStars = 2, BlurredStars = 1
            };
            var dbService = new DatabaseService();

            // Act
            await dbService.AddMswSurfSpotAsync(mswSurfSpot);

            var allMswSurfSpots = await dbService.GetAllMswSurfSpotsAsync();

            // Assert
            allMswSurfSpots.Any(s => s.Url == mswSurfSpot.Url).Should().BeTrue();

            // Act
            await dbService.RemoveMswSurfSpotAsync(mswSurfSpot);

            allMswSurfSpots = await dbService.GetAllMswSurfSpotsAsync();

            // Assert
            allMswSurfSpots.Any(s => s.Url == mswSurfSpot.Url).Should().BeFalse();
        }