1 package cintoo.messages.context; 2 3 import api.cintoo.messages.context.Contexts; 4 import api.cintoo.messages.context.Context; 5 import org.testng.annotations.*; 6 import org.testng.Assert; 7 8 public class TestContexts { 9 @Test 10 public void testIdContext() { 11 Context idContext = Contexts.id("testid"); 12 Assert.assertTrue(idContext instanceof IdContext, "id() returns IdContext"); 13 Assert.assertEquals(idContext, new IdContext("testid"), "id() returns IdContext"); 14 } 15 16 @Test 17 public void testPackageContext() { 18 Context packageContext = Contexts.string("test"); 19 Assert.assertTrue(packageContext instanceof PackageContext, "string() returns PackageContext"); 20 Assert.assertEquals(packageContext, PackageContext.string("test"), "string() returns PackageContext"); 21 } 22 23 } 24 | Popular Tags |