public PopulateWithModelSettings ( IConfigurationView configurationWizard ) : void | ||
configurationWizard | IConfigurationView | |
return | void |
public ConfigurationWizard(ConfigurationController controller) { _controller = controller; InitializeComponent(); AddFlavorNameHeaders(); controller.PopulateWithModelSettings(this); }
public void AddProductConfigurationRows() { var model = new ConfigurationModel(); var flavorNameA = "TestFlavor"; var flavorNameB = "TestFlavor2"; var productA = "ProductA"; var productB = "ProductB"; model.Flavors = new List<ConfigurationModel.FlavorOptions> { new ConfigurationModel.FlavorOptions { FlavorName = flavorNameA, IncludedProductTitles = new List<string> { productA } }, new ConfigurationModel.FlavorOptions { FlavorName = flavorNameB, IncludedProductTitles = new List<string> { productB } } }; var product = new ConfigurationModel.Product {Title = productB}; model.Products = new List<ConfigurationModel.Product> { new ConfigurationModel.Product {Title = productA}, product }; var controller = new ConfigurationController(model); var testView = new ConfigViewForTests(); controller.PopulateWithModelSettings(testView); TestThatViewHasProduct(testView, model.Products[0]); TestThatViewHasProduct(testView, model.Products[1]); TestThatProductIsSelectedForTheseFlavors(testView, model.Products[0], new List<string> { flavorNameA }); TestThatProductIsSelectedForTheseFlavors(testView, model.Products[1], new List<string> { flavorNameB }); }
public ConfigurationWizard(ConfigurationController controller) { _controller = controller; InitializeComponent(); AddFlavorNameHeaders(); controller.PopulateWithModelSettings(this); }
public void AddFlavorWorks() { var model = new ConfigurationModel(); var flavorName = "TestFlavor"; model.Flavors = new List<ConfigurationModel.FlavorOptions> { new ConfigurationModel.FlavorOptions { FlavorName = flavorName}}; var controller = new ConfigurationController(model); var testView = new ConfigViewForTests(); controller.PopulateWithModelSettings(testView); TestThatViewHasFlavor(testView, model.Flavors[0]); }
public void DeleteFlavorWorks() { var deleteFlavor = new ConfigurationModel.FlavorOptions { FlavorName = "DeletedFlavor", DownloadURL = "localhost" }; var model = new ConfigurationModel(); var flavorName = "TestFlavor"; model.Flavors = new List<ConfigurationModel.FlavorOptions> { new ConfigurationModel.FlavorOptions { FlavorName = flavorName }, deleteFlavor }; var controller = new ConfigurationController(model); var testView = new ConfigViewForTests(); controller.PopulateWithModelSettings(testView); TestThatViewHasFlavor(testView, model.Flavors[0]); TestThatViewHasFlavor(testView, model.Flavors[1]); // SUT controller.DeleteLastFlavor(testView); TestThatViewHasFlavor(testView, model.Flavors[0]); TestThatViewDoesNotHaveFlavor(testView, deleteFlavor); }
public void AddTaskSelections() { var model = new ConfigurationModel(); model.Tasks = new ConfigurationModel.TasksToExecuteSettings { GatherFiles = true, BuildSelfExtractingDownloadPackage = true, Compile = true, OutputFolder = "C:/temp", RememberSettings = true, SelfExtractingStyle = "SfxFw", WriteInstallerXml = true, WriteDownloadsXml = true }; var controller = new ConfigurationController(model); var testView = new ConfigViewForTests(); // Assert defaults to ensure a valid test Assert.False(testView.GatherFiles || testView.Compile || testView.BuildSelfExtractingDownloadPackage || testView.RememberSettings || testView.WriteInstallerXml || testView.WriteDownloadsXml, "Expected all booleans to default to false, test invalid"); controller.PopulateWithModelSettings(testView); Assert.True(testView.GatherFiles && testView.Compile && testView.BuildSelfExtractingDownloadPackage && testView.RememberSettings && testView.WriteInstallerXml && testView.WriteDownloadsXml, "Expected all booleans to be set to true"); Assert.That(testView.OutputFolder, Is.EqualTo(model.Tasks.OutputFolder)); Assert.That(testView.SelfExtractingStyle, Is.EqualTo(model.Tasks.SelfExtractingStyle)); }