public void GetServerSettings_Execute_NullValues_ErrorResult()
        {
            //------------Setup for test--------------------------
            var saveServerSettings = new SaveServerSettings();
            var serializer         = new Dev2JsonSerializer();
            //------------Execute Test---------------------------
            var jsonResult = saveServerSettings.Execute(null, null);
            var result     = serializer.Deserialize <ExecuteMessage>(jsonResult);

            //------------Assert Results-------------------------
            Assert.IsTrue(result.HasError);
        }
Example #2
0
        public void SaveServerSettings_Execute_SaveServerSettingsData()
        {
            //------------Setup for test--------------------------
            var serializer    = new Dev2JsonSerializer();
            var workspaceMock = new Mock <IWorkspace>();
            var settingsData  = new ServerSettingsData()
            {
                ExecutionLogLevel = LogLevel.DEBUG.ToString()
            };
            var requestArgs = new Dictionary <string, StringBuilder>();

            requestArgs.Add("ServerSettings", new StringBuilder(serializer.SerializeToBuilder(settingsData).ToString()));

            var saveServerSettings = new SaveServerSettings();
            //------------Execute Test---------------------------
            var jsonResult = saveServerSettings.Execute(requestArgs, workspaceMock.Object);
            var result     = serializer.Deserialize <ExecuteMessage>(jsonResult);

            //------------Assert Results-------------------------
            Assert.IsFalse(result.HasError);
        }