Esempio n. 1
0
        /// <summary>
        /// Executes the request
        /// </summary>
        public void Execute()
        {
            var parser = new AssemblyParser(_options.AssemblyFileName, _options.TargetNamespace, _options.Culture);
            var result = parser.Parse();
            var output = BuildJavaScript(_options.Application, result.ToString());

            using (var writer = new StreamWriter(_options.OutputFileName))
            {
                writer.Write(output);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Executes the request
        /// </summary>
        public void Execute()
        {
            var parser = new AssemblyParser(_options.AssemblyFilename, _options.TargetNamespace, _options.Culture);
            var result = parser.Parse();
            var output = BuildJavaScript(_options.Application, result.ToString());

            using (var writer = new StreamWriter(_options.OutputFilename))
            {
                writer.Write(output);
            }
        }
        public void AssemblyParserParseEnTest(string assemblyFile, string targetNamespace, string culture)
        {
            // Arrange
            var parser = new AssemblyParser(assemblyFile, targetNamespace, culture);

            // Act
            var result = parser.Parse();

            // Assert
            Assert.That(result.Count, Is.EqualTo(2), "Number of children not as expected.");
            Assert.That((string)result.SelectToken("address.city.required.message"), Is.EqualTo("City is required."));
            Assert.That((int)result.SelectToken("address.zipCode.size.min"), Is.EqualTo(4));
            Assert.That((int)result.SelectToken("person.age.max.value"), Is.EqualTo(99));
            Assert.That((string)result.SelectToken("person.url.url.message"), Is.EqualTo("Must be a valid URL."));
        }