예제 #1
0
        public void GetAllDestinationMappingSystems()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                if (MappingController.DeleteAllMappings())
                {
                    if (MappingController.DeleteAllMappingSystems())
                    {
                        MappingSystem mappingSystem = PopulateNewDestinationMappingSystem();
                        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.GetMappingDestinationSystems();

                            //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);
                        }
                    }
                }
            }
        }