public void ExceptionThrownIfResourcesCannotBeFound()
 {
     StringTranslator translator = new StringTranslator();
     ResourceManager manager = new ResourceManager(
                             "UnknownResources",
                             Assembly.GetExecutingAssembly());
     Assert.IsNull(translator.Translate(manager, "UnknownLabel"));
 }
 public void ReturnsNullIfLabelCannotBeFound()
 {
     StringTranslator translator = new StringTranslator();
     ResourceManager manager = new ResourceManager(
                             "Microsoft.Practices.EnterpriseLibrary.Common.Tests.Properties.Resources",
                             Assembly.GetExecutingAssembly());
     Assert.IsNull(translator.Translate(manager, "UnknownLabel"));
 }
 public void ReturnsTranslatedStringForGivenResourceAndLabel()
 {
     StringTranslator translator = new StringTranslator();
     ResourceManager manager = new ResourceManager(
                             "Microsoft.Practices.EnterpriseLibrary.Common.Tests.Properties.Resources",
                             Assembly.GetExecutingAssembly());
     Assert.AreEqual("Foo Text", translator.Translate(manager, "FooLabel"));
 }
Ejemplo n.º 4
0
        public void ExceptionThrownIfResourcesCannotBeFound()
        {
            StringTranslator translator = new StringTranslator();
            ResourceManager  manager    = new ResourceManager(
                "UnknownResources",
                Assembly.GetExecutingAssembly());

            Assert.IsNull(translator.Translate(manager, "UnknownLabel"));
        }
Ejemplo n.º 5
0
        public void ReturnsNullIfLabelCannotBeFound()
        {
            StringTranslator translator = new StringTranslator();
            ResourceManager  manager    = new ResourceManager(
                "Microsoft.Practices.EnterpriseLibrary.Common.Tests.Properties.Resources",
                Assembly.GetExecutingAssembly());

            Assert.IsNull(translator.Translate(manager, "UnknownLabel"));
        }
Ejemplo n.º 6
0
        public void ReturnsTranslatedStringForGivenResourceAndLabel()
        {
            StringTranslator translator = new StringTranslator();
            ResourceManager  manager    = new ResourceManager(
                "Microsoft.Practices.EnterpriseLibrary.Common.Tests.Properties.Resources",
                Assembly.GetExecutingAssembly());

            Assert.AreEqual("Foo Text", translator.Translate(manager, "FooLabel"));
        }