Ejemplo n.º 1
0
 public void SetUp()
 {
     _createConfiguration = new CreateConfigurationFake();
     _createApplication = new CreateApplicationFake();
     _deleteConfiguration = new DeleteConfiguration();
     _getConfigurationByNameAndApplication = new GetConfigurationByNameAndApplication();
     Runner.SqlCompact("Lemonade").Down();
     Runner.SqlCompact("Lemonade").Up();
 }
Ejemplo n.º 2
0
        public void WhenITryToSaveADuplicateConfiguration_ThenSaveConfigurationExceptionIsThrown()
        {
            var saveConfiguration = new CreateConfigurationFake();
            var saveApplication = new CreateApplicationFake();
            var getApplicationByName = new GetApplicationByName();

            var application = new ApplicationBuilder()
                .WithName("Test12345")
                .Build();

            saveApplication.Execute(application);
            application = getApplicationByName.Execute(application.Name);

            var configuration = new ConfigurationBuilder()
                .WithName("MyTestFeature")
                .WithValue("Hello World")
                .WithApplication(application).Build();

            saveConfiguration.Execute(configuration);

            Assert.Throws<CreateConfigurationException>(() => saveConfiguration.Execute(configuration));
        }