예제 #1
0
        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));
        }
예제 #3
0
 public GroupExtendedProxy GetExtendedProxy(GroupBasedProxy basedProxy)
 {
     return(SendRequest <GroupExtendedProxy>("GetExtendedGroup", GetDefaultParameters(), basedProxy.ToJson()));
 }
예제 #4
0
 public Group GetGroup(GroupBasedProxy group)
 {
     return(GetGroup(group.GroupName));
 }
예제 #5
0
 public GroupExtendedProxy GetExtendedProxy(GroupBasedProxy basedProxy)
 {
     return(modelDatabase.GetGroup(basedProxy).ToExtendedProxy());
 }
예제 #6
0
 public void Delete(GroupBasedProxy basedProxy)
 {
     SendRequest("DeleteGroup", GetDefaultParameters(), basedProxy.ToJson());
 }
예제 #7
0
 public void Delete(GroupBasedProxy basedProxy)
 {
     DeleteGroup(ModelDatabase.GetGroup(basedProxy));
     ModelDatabase.SaveChanges();
 }