Exemplo n.º 1
0
        private void RegisterEvent()
        {
            this.TreeView.SelectionChanged += (s, e) => {
                var item  = treeView.GetSelectedNode();
                var label = item.NodeName;

                System.Threading.Tasks.Task.Delay(200).ContinueWith((arg) => {
                    if (!_reset)
                    {
                        CakeHelper.ExecuteCmd(label, _solution);
                        System.Threading.Tasks.Task.Delay(20).ContinueWith((_) => {
                            CakeHelper.ActivateCmd();
                        });
                    }
                    _reset = false;
                });
            };
        }
        public void Should_Only_Set_NotNull_Setting()
        {
            //Setup
            var websiteName = "Batman";

            CakeHelper.DeleteWebsite(websiteName);

            // Arrange
            var websiteSettings = CakeHelper.GetWebsiteSettings(websiteName);
            var serverAuth      = CakeHelper.ReadAuthenticationSettings();

            CakeHelper.CreateWebsite(websiteSettings);

            var anon  = serverAuth.EnableAnonymousAuthentication.Value;
            var basic = serverAuth.EnableBasicAuthentication.Value;
            var win   = serverAuth.EnableWindowsAuthentication.Value;



            var appSettings = CakeHelper.GetApplicationSettings(websiteName);

            appSettings.Authentication = CakeHelper.GetAuthenticationSettings(!anon, null, null);  //only resetting anonymous to inverse of default.

            WebsiteManager manager = CakeHelper.CreateWebsiteManager();
            var            added   = manager.AddApplication(appSettings);

            //Assert
            var webAuth = CakeHelper.ReadAuthenticationSettings(websiteName);
            var appAuth = CakeHelper.ReadAuthenticationSettings(websiteName, appSettings.ApplicationPath);

            AssertAuthentication(serverAuth, webAuth);

            Assert.Equal(!anon, appAuth.EnableAnonymousAuthentication);
            Assert.Equal(basic, appAuth.EnableBasicAuthentication);
            Assert.Equal(win, appAuth.EnableWindowsAuthentication);

            //Teardown
            CakeHelper.DeleteWebsite(websiteName);
        }