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));
        }
Example #2
0
 protected override GroupExtendedProxy Run(NameValues parameters, byte[] requestBody)
 {
     return(databaseGroupReader.GetExtendedProxy(requestBody.FromJson <GroupBasedProxy>()));
 }