public void ItShouldReturn404HttpCode() { var response = new GetOneBeerResponse { Beer = null }; var presenter = new ApiGetOneBeerPresenter(); presenter.Present(response); var viewModel = presenter.ViewModel; Assert.Equal(404, viewModel.HttpCode); }
public void ItShouldReturnLastItems() { var response = new GetOneBeerResponse { Beer = new Beer(Guid.NewGuid(), "Label", "Description", 5) }; var presenter = new ApiGetOneBeerPresenter(); presenter.Present(response); var viewModel = presenter.ViewModel; Assert.True(viewModel.Data.LastItems); }
public void ItShouldReturn200HttpCode() { var response = new GetOneBeerResponse { Beer = new Beer(Guid.NewGuid(), "Label", "Description", 0) }; var presenter = new ApiGetOneBeerPresenter(); presenter.Present(response); var viewModel = presenter.ViewModel; Assert.Equal(200, viewModel.HttpCode); }
public void ItShouldReturnTheSameData() { var response = new GetOneBeerResponse { Beer = new Beer(Guid.NewGuid(), "Label", "Description", 100) }; var presenter = new ApiGetOneBeerPresenter(); presenter.Present(response); var viewModel = presenter.ViewModel; var responseBeer = response.Beer; var viewModelBeer = viewModel.Data; Assert.Equal(viewModelBeer.Id, responseBeer.Id.Value); Assert.Equal(viewModelBeer.Label, responseBeer.Label.Value); Assert.Equal(viewModelBeer.Description, responseBeer.Description.Value); Assert.Equal(viewModelBeer.Stock, responseBeer.Stock.Value); }