public void Parameter_GetById_Test() { //Arrange Parameter entity = new Parameter() { Id = 3, Name = "Another Name", Type = "bool", Value = "33" }; mockRepository .Setup(x => x.GetById(entity.Id)) .Returns(entity); //Act Parameter tEntity = service.GetById(entity.Id); //Assert Assert.NotNull(entity); Assert.Same(entity, tEntity); }