コード例 #1
0
        public async Task NoCriteria()
        {
            var clientServiceSvc = GetService <IClientService>();
            var payload          = new SearchClientPayload {
            };
            var response         = await clientServiceSvc.SearchClientAsync(payload);

            Assert.AreEqual(null, response.Data);
            Assert.AreEqual(false, response.Success);
            Assert.AreNotEqual(null, response.Message);
            Assert.AreEqual(ApiMessageType.Error, response.MessageType);
            Assert.AreEqual(SearchClientStatus.ClientIdFormat, response.StatusCode);
        }
コード例 #2
0
        public async Task SeveralResultsOk()
        {
            var clientServiceSvc = GetService <IClientService>();
            var payload          = new SearchClientPayload {
                Keyword = "000"
            };
            var response = await clientServiceSvc.SearchClientAsync(payload);

            Assert.AreEqual(4, response.Data.Count());
            Assert.AreEqual(true, response.Success);
            Assert.AreEqual(null, response.Message);
            Assert.AreEqual(null, response.MessageType);
            Assert.AreEqual(SearchClientStatus.Ok, response.StatusCode);
        }
コード例 #3
0
        public async Task InvalidKeywordLenght()
        {
            var clientServiceSvc = GetService <IClientService>();
            var payload          = new SearchClientPayload {
                Keyword = "a"
            };
            var response = await clientServiceSvc.SearchClientAsync(payload);

            Assert.AreEqual(null, response.Data);
            Assert.AreEqual(false, response.Success);
            Assert.AreNotEqual(null, response.Message);
            Assert.AreEqual(ApiMessageType.Error, response.MessageType);
            Assert.AreEqual(SearchClientStatus.KeywordFormat, response.StatusCode);
        }
コード例 #4
0
        public async Task <ApiResponse <IEnumerable <ClientDto>, SearchClientStatus> > SearchClientAsync(SearchClientPayload payload)
        {
            StartLog();
            ApiResponse <IEnumerable <ClientDto>, SearchClientStatus> response;

            if (!Validate(payload, out string message, out string property))
            {
                response = Error <SearchClientStatus>(message, property);
            }