Esempio n. 1
0
        public void CreateScriptsCommand()
        {
            // Arrange
            const int  commandId     = 3;
            const bool includeSource = true;

            // Act
            var scriptsCommand = new ScriptsCommand(commandId, includeSource);

            // Assert
            Assert.AreEqual(commandId, scriptsCommand.Id);
            Assert.AreEqual(
                string.Format(
                    "{{\"command\":\"scripts\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"includeSource\":{1}}}}}",
                    commandId, includeSource.ToString().ToLower()),
                scriptsCommand.ToString());
        }
Esempio n. 2
0
        public void CreateScriptsCommandWithOptionalParameters()
        {
            // Arrange
            const int  commandId     = 3;
            const int  moduleId      = 5;
            const bool includeSource = false;

            // Act
            var scriptsCommand = new ScriptsCommand(commandId, includeSource, moduleId);

            // Assert
            Assert.AreEqual(commandId, scriptsCommand.Id);
            Assert.AreEqual(
                string.Format(
                    "{{\"command\":\"scripts\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"includeSource\":{1},\"ids\":[{2}]}}}}",
                    commandId, includeSource.ToString().ToLower(CultureInfo.InvariantCulture), moduleId),
                scriptsCommand.ToString());
        }