コード例 #1
0
        public void TryGetTextForNonExistingValueReturnsFalse()
        {
            var textProvider = new MvxResxTextProvider(_resourceManager);

            string actual;

            Assert.False(textProvider.TryGetText(out actual, null, null, "NonExistingKey"));
            Assert.Null(actual);
        }
コード例 #2
0
        public void TryGetTextSupplyingTypeKeyAndNameOutputsValueMatchingTypeKeyAndName()
        {
            var textProvider = new MvxResxTextProvider(_resourceManager);
            var expected     = $"{MockResourceManager.TypeKey}.{MockResourceManager.DummyName}";

            string actual;

            Assert.True(textProvider.TryGetText(out actual, null, MockResourceManager.TypeKey, MockResourceManager.DummyName));
            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void TryGetTextForExistingValueSupplyingNameOnlyReturnsTrue()
        {
            var textProvider = new MvxResxTextProvider(_resourceManager);
            var expected     = MockResourceManager.DummyName;

            string actual;

            Assert.True(textProvider.TryGetText(out actual, null, null, MockResourceManager.DummyName));
            Assert.Equal(expected, actual);
        }
コード例 #4
0
        public void TryGetTextSupplyingNamespaceAndNameOutputsValueMatchingNamespaceAndName()
        {
            var textProvider = new MvxResxTextProvider(_resourceManager);
            var expected     = $"{MockResourceManager.LocalizationNamespace}.{MockResourceManager.DummyName}";

            string actual;

            Assert.IsTrue(textProvider.TryGetText(out actual, MockResourceManager.LocalizationNamespace, null, MockResourceManager.DummyName));
            Assert.AreEqual(expected, actual);
        }