public void SaveGame_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("game"), () => {
         m_target.SaveGame(null);
     });
 }
Пример #2
0
 public void SaveAvatar_NullWorld_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("world"), () => {
         EnvironmentHelper.SaveAvatar(MockRepository.GenerateMock <IEnvironment>(), null);
     });
 }
Пример #3
0
 public void CreateCrossoverByName_InvalidName_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("There is no ICrossover implementation with name 'Test'.", "name"), () => {
         CrossoverService.CreateCrossoverByName("Test");
     });
 }
 public void SaveDeveloper_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("developer"), () => {
         m_target.SaveDeveloper(null);
     });
 }
Пример #5
0
 public void GetJob_InvalidJob_Exception()
 {
     ExceptionAssert.IsThrowing(new ConfigurationErrorsException("Job with name 'Test' was not found."), () => {
         JobService.GetJob("Test");
     });
 }
Пример #6
0
 public void GetGenerationStrategyTypeByName_InvalidName_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("There is no IGenerationStrategy implementation with name 'Test'.", "name"), () => {
         PopulationService.GetGenerationStrategyTypeByName("Test");
     });
 }
Пример #7
0
 public void Constructor_NullFitness_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("fitness"), () => {
         new GeneticAlgorithm(new Population(2, 2, new ChromosomeStub()), null, null, null, null);
     });
 }
 public void SavePerson_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("person"), () => {
         m_target.SavePerson(null);
     });
 }
Пример #9
0
 public void CreateSelectionByName_InvalidName_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("There is no ISelection implementation with name 'Test'.", "name"), () => {
         SelectionService.CreateSelectionByName("Test");
     });
 }
 public void SaveLanguage_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("language"), () => {
         m_target.SaveLanguage(null);
     });
 }
 public void DeletePerson_PersonNotExistis_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("Person with key '0' does not exists."), () => {
         m_target.DeletePerson(0);
     });
 }
 public void DeleteLanguage_LanguageNotExistis_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("Language with key '0' does not exists."), () => {
         m_target.DeleteLanguage(0);
     });
 }
 public void SavePlatform_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("platform"), () => {
         m_target.SavePlatform(null);
     });
 }
 public void DeletePlatform_PlatformNotExistis_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("Platform with key '0' does not exists."), () => {
         m_target.DeletePlatform(0);
     });
 }
Пример #15
0
 public void GetEntityByKey_DoesNotExistsEntityWithName_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("There is no entity with the name 'Jogo'."), () => {
         ServiceFacade.GetEntity("Jogo", 1);
     });
 }
Пример #16
0
 public void CreateSelectionByName_ValidNameButInvalidConstructorArgs_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("A ISelection's implementation with name 'Elite' was found, but seems the constructor args were invalid.", "constructorArgs"), () => {
         SelectionService.CreateSelectionByName("Elite", 1);
     });
 }
Пример #17
0
 public void CreateGenerationStrategyByName_ValidNameButInvalidConstructorArgs_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("A IGenerationStrategy's implementation with name 'Tracking' was found, but seems the constructor args were invalid.", "constructorArgs"), () => {
         PopulationService.CreateGenerationStrategyByName("Tracking", 1);
     });
 }
Пример #18
0
 public void CreateMutationByName_ValidNameButInvalidConstructorArgs_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("A IMutation's implementation with name 'Uniform' was found, but seems the constructor args were invalid.", "constructorArgs"), () => {
         MutationService.CreateMutationByName("Uniform", 1f);
     });
 }
Пример #19
0
 public void Constructor_NullPopulation_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("population"), () => {
         new GeneticAlgorithm(null, null, null, null, null);
     });
 }
Пример #20
0
 public void GetMutationTypeByName_InvalidName_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("There is no IMutation implementation with name 'Test'.", "name"), () => {
         MutationService.GetMutationTypeByName("Test");
     });
 }
Пример #21
0
 public void Constructor_NullSelection_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("selection"), () => {
         new GeneticAlgorithm(new Population(2, 2, new ChromosomeStub()), MockRepository.GenerateMock <IFitness>(), null, null, null);
     });
 }
 public void SaveCompany_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("company"), () => {
         m_target.SaveCompany(null);
     });
 }
 public void DeleteDeveloper_DeveloperNotExistis_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("Developer with Id '0' does not exists."), () => {
         m_target.DeleteDeveloper(0);
     });
 }
 public void DeleteCompany_CompanyNotExistis_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("Company with key '0' does not exists."), () => {
         m_target.DeleteCompany(0);
     });
 }
Пример #25
0
 public void SaveAvatar_NullEnvironment_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("environment"), () => {
         EnvironmentHelper.SaveAvatar((IEnvironment)null, new World());
     });
 }
Пример #26
0
 public void Constructor_OneCity_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("The minimum length for a chromosome is 2 genes."), () => {
         new TspChromosome(1);
     });
 }
Пример #27
0
 public void SaveAvatar_AvatarUnavailable_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("Is impossible save the avatar because the environemnt has no UIInformation about it.", "environment"), () => {
         EnvironmentHelper.SaveAvatar(MockRepository.GenerateMock <IEnvironment>(), new World());
     });
 }
Пример #28
0
 public void CreateService_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("entity"), () => {
         ServiceFacade.CreateService(null);
     });
 }
Пример #29
0
 public void CreateCrossoverByName_ValidNameButInvalidConstructorArgs_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentException("A ICrossover's implementation with name 'One-Point' was found, but seems the constructor args were invalid.", "constructorArgs"), () => {
         CrossoverService.CreateCrossoverByName("One-Point", 1, 2, 3);
     });
 }
 public void SaveAppliedTag_Null_Exception()
 {
     ExceptionAssert.IsThrowing(new ArgumentNullException("appliedtag"), () => {
         m_target.SaveAppliedTag(null);
     });
 }