use of com.android.tools.idea.npw.project.DomainToPackageExpression in project android by JetBrains.
the class DomainToPackageExpressionTest method packageNameDeriverSantizesCompanyDomainKey.
@Test
public void packageNameDeriverSantizesCompanyDomainKey() {
StringProperty companyDomain = new StringValueProperty("sub.exa-mple.com");
StringProperty applicationName = new StringValueProperty("My&App");
Expression<String> computedPackageName = new DomainToPackageExpression(companyDomain, applicationName);
assertEquals("com.exa_mple.sub.myapp", computedPackageName.get());
companyDomain.set("#.badstartchar.com");
assertEquals("com.badstartchar.myapp", computedPackageName.get());
companyDomain.set("TEST.ALLCAPS.COM");
assertEquals("com.allcaps.test.myapp", computedPackageName.get());
applicationName.set("#My $AppLICATION");
assertEquals("com.allcaps.test.myapplication", computedPackageName.get());
}
Aggregations