public void DeleteGroupFunctionTest_ShouldBeSuccess() { var group = new GroupBasedProxy { GroupName = "nameOfGroup" }; RunServer(new DeleteGroupFunction(DatabaseAuthorizer, databaseGroupEditor)); SendRequest("DeleteGroup", GetDefaultParameters(), group.ToJson()); A.CallTo(() => databaseGroupEditor.Delete(group)).MustHaveHappened(Repeated.Exactly.Once); }
public void GetExtendedGroupFunctionTest_ShouldBeSuccess() { var inputBasedGroup = new GroupBasedProxy { GroupName = "firstGroup" }; var inputExtendedGroup = new GroupExtendedProxy { GroupName = "firstGroup" }; A.CallTo(() => databaseGroupReader.GetExtendedProxy(inputBasedGroup)).Returns(inputExtendedGroup); RunServer(new GetExtendedGroupFunction(DatabaseAuthorizer, databaseGroupReader)); var receivedGroup = SendRequest <GroupExtendedProxy>("GetExtendedGroup", GetDefaultParameters(), inputBasedGroup.ToJson()); A.CallTo(() => databaseGroupReader.GetExtendedProxy(inputBasedGroup)).MustHaveHappened(Repeated.Exactly.Once); Assert.That(receivedGroup, Is.EqualTo(inputExtendedGroup)); }
public GroupExtendedProxy GetExtendedProxy(GroupBasedProxy basedProxy) { return(SendRequest <GroupExtendedProxy>("GetExtendedGroup", GetDefaultParameters(), basedProxy.ToJson())); }
public Group GetGroup(GroupBasedProxy group) { return(GetGroup(group.GroupName)); }
public GroupExtendedProxy GetExtendedProxy(GroupBasedProxy basedProxy) { return(modelDatabase.GetGroup(basedProxy).ToExtendedProxy()); }
public void Delete(GroupBasedProxy basedProxy) { SendRequest("DeleteGroup", GetDefaultParameters(), basedProxy.ToJson()); }
public void Delete(GroupBasedProxy basedProxy) { DeleteGroup(ModelDatabase.GetGroup(basedProxy)); ModelDatabase.SaveChanges(); }