public void WhenITryToSaveAFeature_ThenFeatureHasBeenSavedEventIsRaisedWithCorrectDetails() { var saveFeature = new CreateFeatureFake(); var updateFeature = new UpdateFeature(); var saveApplication = new CreateApplicationFake(); var getApplicationByName = new GetApplicationByName(); var getFeatureByNameAndApplication = new GetFeatureByNameAndApplication(); var application = new ApplicationBuilder() .WithName("Test12345") .Build(); saveApplication.Execute(application); application = getApplicationByName.Execute(application.Name); var feature = new FeatureBuilder() .WithName("MyTestFeature") .WithApplication(application).Build(); saveFeature.Execute(feature); feature = getFeatureByNameAndApplication.Execute(feature.Name, application.Name); feature.Name = "Ponies"; updateFeature.Execute(feature); feature = getFeatureByNameAndApplication.Execute(feature.Name, application.Name); Assert.That(feature.Name, Is.EqualTo("Ponies")); }
public void SetUp() { _createFeature = new CreateFeatureFake(); _createApplication = new CreateApplicationFake(); _deleteFeature = new DeleteFeature(); _getApplicationByName = new GetApplicationByName(); _getFeatureByNameAndApplication = new GetFeatureByNameAndApplication(); Runner.SqlCompact("Lemonade").Down(); Runner.SqlCompact("Lemonade").Up(); }
public void SetUp() { _getFeature = new GetFeatureByNameAndApplication(); _createApplication = new CreateApplicationFake(); _createFeature = new CreateFeatureFake(); _createFeatureOverride = new CreateFeatureOverrideFake(); _server = new Server(64978); Runner.SqlCompact(ConnectionString).Down(); Runner.SqlCompact(ConnectionString).Up(); _bootstrapper = new TestBootstrapper(); _browser = new Browser(_bootstrapper, context => context.UserHostAddress("localhost")); }
public void WhenITryToSaveADuplicateFeature_ThenSaveFeatureExceptionIsThrown() { var saveFeature = new CreateFeatureFake(); var saveApplication = new CreateApplicationFake(); var getApplicationByName = new GetApplicationByName(); var application = new ApplicationBuilder() .WithName("Test12345") .Build(); saveApplication.Execute(application); application = getApplicationByName.Execute(application.Name); var feature = new FeatureBuilder() .WithName("MyTestFeature") .WithApplication(application).Build(); saveFeature.Execute(feature); Assert.Throws<CreateFeatureException>(() => saveFeature.Execute(feature)); }