public void WhenPopulationIsInitialised_InitialiserIsRequestedFromIndividual_ShouldHaveCorrectName()
        {
            Population <byte> population = new Population <byte> ();

            population.Initialise(5, 1);

            Assert.AreEqual(InitialiserProvider.GetInitialiser <byte>().Name, population.Individuals [0].Initialiser.Name);
        }
        public void WhenIndividualIsInitialised_InitialiserIsRequestedFromIndividual_ShouldHaveCorrectName()
        {
            Individual <byte> individual = new Individual <byte> ();

            individual.Initialise(2);

            Assert.AreEqual(InitialiserProvider.GetInitialiser <byte>().Name, individual.Initialiser.Name);
        }
        public void WhenInitialiserIsOverloaded_RequestReturnsOverloadedInitialiser()
        {
            NewByteBasedGenomeInitialiser newByteInitialiser = new NewByteBasedGenomeInitialiser();

            InitialiserProvider.AddInitialiser(newByteInitialiser);

            var initialiser = InitialiserProvider.GetInitialiser <byte> ();

            Assert.AreEqual(newByteInitialiser.Name, initialiser.Name);
        }
 public void WhenInitialiserRequested_TypeDoesNotExist_ResultingInitialiserNotAvailableExceptionShouldGiveCorrectType()
 {
     try
     {
         InitialiserProvider.GetInitialiser <UIntPtr>();
     }
     catch (InitialiserNotAvailableException e) {
         Assert.AreEqual(typeof(UIntPtr), e.RequestedInitialiserType);
     }
 }
        public void WhenInitialiserRequested_TypeDoesNotExist_InitialiserNotAvailableShouldBeThrown()
        {
            var initialiser = InitialiserProvider.GetInitialiser <UIntPtr> ();

            Assert.IsNotNull(initialiser);
        }
        public void WhenInitialiserRequested_TypeExists_InitialiserShouldReturn()
        {
            var initialiser = InitialiserProvider.GetInitialiser <byte> ();

            Assert.IsNotNull(initialiser);
        }