public void TestAssignsStudlyCaps() { var rubyNamingConvention = new RubyNamingConvention(); Helper.AssertTemplateResult( expected: ".foo.", template: "{% assign FoO = values %}.{{ fOo[0] }}.", anonymousObject: new { values = new[] { "foo", "bar", "baz" } }, namingConvention: rubyNamingConvention); Helper.AssertTemplateResult( expected: ".bar.", template: "{% assign fOo = values %}.{{ fOO[1] }}.", anonymousObject: new { values = new[] { "foo", "bar", "baz" } }, namingConvention: rubyNamingConvention); var csNamingConvention = new CSharpNamingConvention(); Helper.AssertTemplateResult( expected: ".foo.", template: "{% assign Foo = values %}.{{ Foo[0] }}.", anonymousObject: new { values = new[] { "foo", "bar", "baz" } }, namingConvention: csNamingConvention); Helper.AssertTemplateResult( expected: ".bar.", template: "{% assign fOo = values %}.{{ fOo[1] }}.", anonymousObject: new { values = new[] { "foo", "bar", "baz" } }, namingConvention: csNamingConvention); }
public void TestRubyFullUpperCase() { RubyNamingConvention namingConvention = new RubyNamingConvention(); Assert.AreEqual("id", namingConvention.GetMemberName("ID")); Assert.AreEqual("hellocruelworld", namingConvention.GetMemberName("HELLOCRUELWORLD")); }
static Template() { RegexTimeOut = TimeSpan.FromSeconds(10); NamingConvention = new RubyNamingConvention(); FileSystem = new BlankFileSystem(); Tags = new Dictionary <string, Tuple <ITagFactory, Type> >(); SafeTypeTransformers = new Dictionary <Type, Func <object, object> >(); ValueTypeTransformers = new Dictionary <Type, Func <object, object> >(); }
public void TestRubyWithTurkishCulture() { using (CultureHelper.SetCulture("tr-TR")) { RubyNamingConvention namingConvention = new RubyNamingConvention(); // in Turkish ID.ToLower() returns a localized i, and this fails Assert.AreEqual("id", namingConvention.GetMemberName("ID")); } }
public void TestRubyWithTurkishCulture() { System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("tr-TR"); RubyNamingConvention namingConvention = new RubyNamingConvention(); // in Turkish ID.ToLower() returns a localized i, and this fails Assert.AreEqual("id", namingConvention.GetMemberName("ID")); }
public void TestRubyMoreComplexName() { RubyNamingConvention namingConvention = new RubyNamingConvention(); Assert.AreEqual("hello_cruel_world", namingConvention.GetMemberName("HelloCruelWorld")); }
public void TestRubySimpleName() { RubyNamingConvention namingConvention = new RubyNamingConvention(); Assert.AreEqual("test", namingConvention.GetMemberName("Test")); }
public void TestRubyComplexName() { var namingConvention = new RubyNamingConvention(); Assert.AreEqual("hello_world", namingConvention.GetMemberName("HelloWorld")); }