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

            A.CallTo(() => databaseUserReader.GetUsersWithUsingFilters(login)).Returns(inputUsers);

            RunServer(new GetUsersWithUsingFiltersFunction(DatabaseAuthorizer, databaseUserReader));

            var parameters = GetDefaultParameters();

            parameters[HttpParameters.LoginForFilter] = login;
            var receivedUsers = SendRequest <UserBasedProxy[]>("GetUsersWithUsingFilters", parameters);

            A.CallTo(() => databaseUserReader.GetUsersWithUsingFilters(login)).MustHaveHappened(Repeated.Exactly.Once);
            CollectionAssert.AreEqual(inputUsers, receivedUsers);
        }
Example #2
0
        protected override UserBasedProxy[] Run(NameValues parameters, byte[] requestBody)
        {
            var login = parameters.GetValueOrNull(HttpParameters.LoginForFilter);

            return(databaseUserReader.GetUsersWithUsingFilters(login));
        }