コード例 #1
0
        public void GetAllListings_ReturnsAListingListOfValueZero_WhenCalledAndDatabaseIsEmpty()
        {
            // Arrange
            int expected = 0;
            SqlServerListingRepository listingRepo = new SqlServerListingRepository(context);

            // Act
            int actual = listingRepo.GetAllListings().Count();

            // Assert
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void GetAllListings_ReturnsAListingListOfLengthOne_WhenCalledAndDatabaseHasOneListing()
        {
            // Arrange
            int expected = 1;

            InsertData();
            SqlServerListingRepository listingRepo = new SqlServerListingRepository(context);

            // Act
            int actual = listingRepo.GetAllListings().Count();

            // Assert
            Assert.AreEqual(expected, actual);
        }