public void GetGroupById_ShouldReturn_NotNull() { // Arrange GroupsDtoModel group = null; fakeGroupsRepository.Setup(a => a.GetById(1)).Returns(new GroupsModel()); groupsService = new GroupsService(fakeGroupsRepository.Object); try { // Act group = groupsService.GetGroupById(1); } catch (Exception ex) { errorMessage = ex.Message + " | " + ex.StackTrace; } // Assert Assert.IsNotNull(group, errorMessage); }