Example #1
0
        public async Task SetCoorLongNull()
        {
            var client = await GetAdminClientAsync();

            var pet = new SetCoorCommand
            {
                Id  = 1,
                Lat = 586.2
            };

            var content  = Utilities.GetRequestContent(pet);
            var response = await client.PostAsync("/api/Store/SetCoordinates", content);

            Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
        }
Example #2
0
        public async Task SetCoorIdNotFound()
        {
            var client = await GetAdminClientAsync();

            var pet = new SetCoorCommand
            {
                Id   = 77777,
                Lat  = 586.2,
                Long = -135.6
            };

            var content  = Utilities.GetRequestContent(pet);
            var response = await client.PostAsync("/api/Store/SetCoordinates", content);

            Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
        }
Example #3
0
        public async Task SetCoorSuccessful()
        {
            var client = await GetAdminClientAsync();

            var pet = new SetCoorCommand
            {
                Id   = 1,
                Lat  = 586.2,
                Long = -135.6
            };

            var content  = Utilities.GetRequestContent(pet);
            var response = await client.PostAsync("/api/Store/SetCoordinates", content);

            response.EnsureSuccessStatusCode();

            var result = await Utilities.GetResponseContent <SetCoorResponse>(response);

            Assert.IsType <SetCoorResponse>(result);
        }
Example #4
0
 public async Task <ActionResult <SetCoorResponse> > SetCoordinates([FromBody] SetCoorCommand command)
 {
     return(Ok(await Mediator.Send(command)));
 }