public void GetShouldReturnAllContracts() { MyWebApi .Controller <ContractsController>() .WithResolvedDependencies(DummyServices.GetDummyContractsService()) .Calling(c => c.Get()) .ShouldReturn() .Ok() .WithResponseModelOfType <IQueryable <ContractResponseModel> >() .Passing(c => c.Count() == DummyRepositories.NumberOfTestObjects); }
public void GetByIdShouldReturnTheProperContracts() { MyWebApi .Controller <ContractsController>() .WithResolvedDependencies(DummyServices.GetDummyContractsService()) .Calling(c => c.GetContractById(4)) .ShouldReturn() .Ok() .WithResponseModelOfType <ContractResponseModel>() .Passing(c => c.Id == 4); }