public IHttpActionResult GetGroup(Guid groupId) { if (groupId == Guid.Empty) { throw new ArgumentException("groupId must be defined."); } Group group = mapperFactory.CreateGroupMapper().Map(identityManagementService.GetGroup(groupId)); return(Ok(group)); }
public void GetGroup() { IGroup group = Substitute.For <IGroup>(); group.IsDisabled.Returns(true); group.Description.Returns("MyDescription"); group.Name.Returns("GroupName"); identityManagementService.GetGroup(Arg.Any <Guid>()).Returns(group); OkNegotiatedContentResult <Group> response = sut.GetGroup(Guid.NewGuid()) as OkNegotiatedContentResult <Group>; Assert.IsNotNull(response); Assert.IsNotNull(response.Content); Assert.IsTrue(response.Content.IsDisabled); Assert.AreEqual("MyDescription", response.Content.Description); Assert.AreEqual("GroupName", response.Content.Name); }