public void GetAllSourceMappingSystems() { using (TransactionScope scope = new TransactionScope()) { if (MappingController.DeleteAllMappings()) { if (MappingController.DeleteAllMappingSystems()) { MappingSystem mappingSystem = PopulateNewSourceMappingSystem(); mappingSystem.Id = MappingController.SaveMappingSystem(mappingSystem); if (mappingSystem.Id != -1) { //retrieve all mapping Systems and the one we saved should return at least List <MappingSystem> mappingSystems = MappingController.GetMappingSourceSystems(); //so the count should be >0 Assert.IsTrue(mappingSystems.Count > 0); //check for our new id Assert.IsTrue(mappingSystems.Find(delegate(MappingSystem currentItem) { return(currentItem.Id == mappingSystem.Id); }) != null); } } } } }