Пример #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);
        }
Пример #2
0
 public GroupExtendedProxy GetExtendedProxy(GroupBasedProxy basedProxy)
 {
     return(SendRequest <GroupExtendedProxy>("GetExtendedGroup", GetDefaultParameters(), basedProxy.ToJson()));
 }
        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));
        }
Пример #4
0
 public void Delete(GroupBasedProxy basedProxy)
 {
     SendRequest("DeleteGroup", GetDefaultParameters(), basedProxy.ToJson());
 }