public void GetAllUsersFunctionTest_ShouldBeSuccess()
        {
            var inputUsers = new[] {
                new UserBasedProxy {
                    Login = "******"
                },
                new UserBasedProxy {
                    Login = "******"
                }
            };

            A.CallTo(() => databaseUserReader.GetAllBasedProies()).Returns(inputUsers);

            RunServer(new GetAllUsersFunction(DatabaseAuthorizer, databaseUserReader));
            var receivedUsers = SendRequest <UserBasedProxy[]>("GetAllUsers", GetDefaultParameters());

            A.CallTo(() => databaseUserReader.GetAllBasedProies()).MustHaveHappened(Repeated.Exactly.Once);
            CollectionAssert.AreEqual(inputUsers, receivedUsers);
        }
Exemple #2
0
 protected override UserBasedProxy[] Run(NameValues parameters, byte[] requestBody)
 {
     return(databaseUserReader.GetAllBasedProies());
 }