public void Returns_uncertified_deployments_by_application_and_environment() { var criteria = new CriterionSet(); criteria.AddCriterion(new Criterion(Deployment.APPLICATION, "SampleApp1")); criteria.AddCriterion(new Criterion(Deployment.ENVIRONMENT, "Environment")); criteria.AddCriterion(new Criterion(Deployment.CERTIFIED_ON, null)); criteria.AddCriterion(new Criterion(Deployment.RESULT, DeploymentResult.Success)); criteria.OrderBy = Deployment.DEPLOYED_ON; criteria.SortOrder = SortOrder.Descending; var foundDeployments = new Deployment[0]; var mocks = new MockRepository(); var repository = mocks.CreateMock<IPersistentObjectRepository>(); using (mocks.Record()) { repository.ConfigurationFile = "deployer.hibernate.cfg.xml"; Expect.Call(repository.FindAll<Deployment>(criteria)).Return(foundDeployments); } using (mocks.Playback()) { IDeploymentRepository deploymentRepository = new DeploymentRepository(repository); var deployments = deploymentRepository.FindSuccessfulUncertified("SampleApp1", "Environment"); Assert.That(deployments, Is.SameAs(foundDeployments)); } mocks.VerifyAll(); }