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