public async Task <ResourceResponse <Document> > CreateAdviserDetailAsync(Models.AdviserDetail adviserDetail)
        {
            var collectionUri = DocumentDBHelper.CreateDocumentCollectionUri();

            var client = DocumentDBClient.CreateDocumentClient();

            if (client == null)
            {
                return(null);
            }

            var response = await client.CreateDocumentAsync(collectionUri, adviserDetail);

            return(response);
        }
        public async Task <Models.AdviserDetail> CreateAsync(Models.AdviserDetail adviserDetail)
        {
            if (adviserDetail == null)
            {
                return(null);
            }

            adviserDetail.SetDefaultValues();

            var documentDbProvider = new DocumentDBProvider();

            var response = await documentDbProvider.CreateAdviserDetailAsync(adviserDetail);

            return(response.StatusCode == HttpStatusCode.Created ? (dynamic)response.Resource : (Guid?)null);
        }
        public void Setup()
        {
            _adviserDetail = Substitute.For <Models.AdviserDetail>();

            _request = new HttpRequestMessage()
            {
                Content    = new StringContent(string.Empty),
                RequestUri =
                    new Uri($"http://localhost:7071/api/AdviserDetails/1e1a555c-9633-4e12-ab28-09ed60d51cb")
            };

            _log = Substitute.For <ILogger>();
            _httpRequestMessageHelper = Substitute.For <IHttpRequestMessageHelper>();
            _getAdviserDetailByIdHttpTriggerService = Substitute.For <IGetAdviserDetailByIdHttpTriggerService>();
            _httpRequestMessageHelper.GetTouchpointId(_request).Returns("00000000001");
        }
예제 #4
0
        public void Setup()
        {
            _address = Substitute.For <Models.AdviserDetail>();

            _request = new HttpRequestMessage()
            {
                Content    = new StringContent(string.Empty),
                RequestUri =
                    new Uri($"http://localhost:7071/api/AdviserDetails/")
            };

            _log = Substitute.For <ILogger>();
            _httpRequestMessageHelper = Substitute.For <IHttpRequestMessageHelper>();
            _validate = Substitute.For <IValidate>();
            _postAdviserDetailHttpTriggerService = Substitute.For <IPostAdviserDetailHttpTriggerService>();
            _httpRequestMessageHelper.GetTouchpointId(_request).Returns("00000000001");
        }
        public void Setup()
        {
            _address      = Substitute.For <Models.AdviserDetail>();
            _addressPatch = Substitute.For <Models.AdviserDetailPatch>();

            _request = new HttpRequestMessage()
            {
                Content    = new StringContent(string.Empty),
                RequestUri =
                    new Uri($"http://localhost:7071/api/Customers/7E467BDB-213F-407A-B86A-1954053D3C24/" +
                            $"AdviserDetails/1e1a555c-9633-4e12-ab28-09ed60d51cb3")
            };

            _log      = Substitute.For <ILogger>();
            _validate = Substitute.For <IValidate>();
            _httpRequestMessageHelper             = Substitute.For <IHttpRequestMessageHelper>();
            _patchAdviserDetailHttpTriggerService = Substitute.For <IPatchAdviserDetailHttpTriggerService>();
            _httpRequestMessageHelper.GetTouchpointId(_request).Returns("00000000001");
        }