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"));
 }
Пример #4
0
        public void ExceptionThrownIfResourcesCannotBeFound()
        {
            StringTranslator translator = new StringTranslator();
            ResourceManager  manager    = new ResourceManager(
                "UnknownResources",
                Assembly.GetExecutingAssembly());

            Assert.IsNull(translator.Translate(manager, "UnknownLabel"));
        }
Пример #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"));
        }
Пример #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"));
        }