public void WhenGettingEntity_ThenReturnsCorrectEntity() { // Arrange var repositoryMock = new Mock<IContentBlobRepository>(); ContentBlob newEntity = DefaultModelHelper.DummyPopulatedContentBlob(); repositoryMock.Setup(repo => repo.GetById(It.IsAny<int>())).Returns(newEntity); // Act var services = new ContentBlobService(repositoryMock.Object, new Mock<IUnitOfWork>().Object); ContentBlob returnedEntity = services.GetById(1); // Assert Assert.NotNull(returnedEntity); Assert.Equal("Html", returnedEntity.Html); }