Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            GWydiRWizardUI ui = new GWydiRWizardUI();
            Wizard wizard = new Wizard(); // need to add an object to congiure the wizard from subscritions/config files
            AuthorisationModel authModel = new AuthorisationModel(ui, wizard);
            ConfigurationModel confModel = new ConfigurationModel(ui, wizard);
            ProductionModel prodModel = new ProductionModel(ui, wizard);

            Application.Run(ui);
        }
        public void GetDNSNameFormattedTest()
        {
            //Arrange
            string dnsName = "AcloudService";

            IWizard mockWizard = MockRepository.GenerateStub<IWizard>();

            IConfigurationView mockConfView = MockRepository.GenerateStub<IConfigurationView>();
            mockConfView.Stub(x => x.GetCloudServiceName()).Return(dnsName);

            model = new OverRiddenConfigModel_1(mockWizard, mockConfView);

            //Act
            string cloudUrl = model.GetDNSName();

            //Assert
            Assert.IsTrue((dnsName + ".cloudapp.net").Equals(cloudUrl));
        }
        public void GetConnectionStringProperlyFormattedDataStoreTest()
        {
            //Arrange
            string appName = "apptestname";
            string appKey = "atestkey-1234-1234-1234";

            IWizard mockWizard = MockRepository.GenerateStub<IWizard>();

            IConfigurationView mockConfView = MockRepository.GenerateStub<IConfigurationView>();
            mockConfView.Stub(x => x.GetDataStoreName()).Return(appName);
            mockConfView.Stub(x => x.GetDataStoreKey()).Return(appKey);

            model = new OverRiddenConfigModel_1(mockWizard, mockConfView);

            //Act
            string connectionString = model.GetConnectionString(GWydiR.Flags.AccountType.DataStorage);

            //Assert
            Assert.IsTrue(("DefaultEndpointsProtocol=https;AccountName=" + appName + ";AccountKey=" + appKey).Equals(connectionString));
        }
 public void seetup()
 {
     model = new ConfigurationModel();
 }