public async Task EditSale_Success_ReturnStatusCodeOk()
        {
            IHttpActionResult result = await saleController.Edit(new Guid("3bc4d343-1a0d-432f-a190-d8f76ebb1ab9"), new Sale());

            HttpJsonApiResult <SaleViewModel> contentResult = result as HttpJsonApiResult <SaleViewModel>;

            Assert.AreEqual(HttpStatusCode.OK, contentResult.StatusCode);
        }
Exemplo n.º 2
0
        public async void ReturnValidModelForCorrectId(int?id)
        {
            var result = await sut.Edit(id);

            var vr = Assert.IsType <ViewResult>(result);

            fixture.repositoryWrapper.Verify(y => y.Sale.GetSaleByIdAsync(id), Times.Once);
            Assert.Equal("Edit", vr.ViewName);
            Assert.IsAssignableFrom <SaleManagementDTO>(vr.Model);
        }