예제 #1
0
        public async Task GetAssignmentByIdAsync_ValidId_ReturnsAssignmentData()
        {
            // Arrange
            var service = new AssignmentService(dbContext);
            int id      = 1;

            // Act
            var response = await service.GetByIdAsync(id);

            dbContext.Dispose();

            // Assert
            Assert.NotNull(response);
            Assert.True(response.Name.Equals("Set A"));
            Assert.True(response.Title.Equals("A"));
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }