public void DeleteOpportunity_BadRequest() { var jsonDataTable = @""; var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonDataTable); var control = new OpportunityController(_opportunityService.Object); var result = control.DeleteOpportunity(opportunity); var badRequestResult = result as BadRequestResult; Assert.AreEqual(400, badRequestResult.StatusCode); }
public void DeleteOpportunity_Ok() { var jsonDataTable = @"{ 'OpportunityId': 1 }"; var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonDataTable); var control = new OpportunityController(_opportunityService.Object); var result = control.DeleteOpportunity(opportunity); var okResult = result as OkResult; Assert.AreEqual(200, okResult.StatusCode); }