public void WriteClrType_AmbiguousWithNested() { var builder = new TextBuilder(); builder.Using.Add("System.Text"); builder.Using.Add("Umbraco.ModelsBuilder.Tests"); builder.ModelsNamespaceForTests = "SomeRandomNamespace"; var sb = new StringBuilder(); builder.WriteClrType(sb, typeof(ASCIIEncoding.Nested)); Assert.AreEqual("global::Umbraco.ModelsBuilder.Tests.ASCIIEncoding.Nested", sb.ToString()); }
public void WriteClrTypeAnother_WithoutUsing() { var builder = new TextBuilder(); builder.ModelsNamespaceForTests = "Umbraco.ModelsBuilder.Tests.Models"; var sb = new StringBuilder(); builder.WriteClrType(sb, typeof(StringBuilder)); Assert.AreEqual("System.Text.StringBuilder", sb.ToString()); }
public void WriteClrType_AmbiguousNot() { var builder = new TextBuilder(); builder.Using.Add("System.Text"); builder.Using.Add("Umbraco.ModelsBuilder.Tests"); builder.ModelsNamespaceForTests = "Umbraco.ModelsBuilder.Tests.Models"; var sb = new StringBuilder(); builder.WriteClrType(sb, typeof(System.Text.ASCIIEncoding)); Assert.AreEqual("ASCIIEncoding", sb.ToString()); }
public void WriteClrTypeUsing(string expected, Type input) { var builder = new TextBuilder(); builder.Using.Add("Umbraco.ModelsBuilder.Tests"); builder.ModelsNamespaceForTests = "ModelsNamespace"; var sb = new StringBuilder(); builder.WriteClrType(sb, input); Assert.AreEqual(expected, sb.ToString()); }