public IMapper TestMapper; // Mapper to use for the test fixture

        /// <summary>
        /// Configure the test fixture
        /// </summary>
        public AutoMapperTestsFixture()
        {
            // Initialise the mapper with the correct namespace
            AutoMapperProfile.Initialise();

            // Create the test mapper
            TestMapper = new Mapper(Mapper.Configuration);
        }
        public void Populate_ConnectionModel()
        {
            // Arrange
            Guid credentialsId = Guid.NewGuid(); // Set the fixed id of the credentials

            // Create a new package to pick the credentials up from in the populate routine
            Package package = new Package()
            {
                CredentialsStore = new List <Credentials>()
                {
                    new Credentials()
                    {
                        Id = credentialsId, Name = "Dummy Credentials"
                    }
                }
            };

            // Create a new connection model without the populated fields
            DataConnectionModel model = new DataConnectionModel()
            {
                Credentials =
                    new KeyValuePair <Guid, string>
                        (credentialsId, String.Empty),
                ProviderType = (Int32)DataProviderType.SQLProvider
            };

            // Set up the mapper to map any needed objects
            AutoMapperProfile.Initialise();
            IMapper mapper = new Mapper(Mapper.Configuration);

            // Act
            model = ConnectionApiHelper.PopulateModel(mapper, package, model);

            // Assert
            Assert.True(model.Credentials.Value != String.Empty);
            Assert.True(model.ProviderData != null);
        }