Example #1
0
        private static void SetupBackend()
        {
            var backend = new InMemoryBackend();

            backend.AddTranslation("en", "translation", "exampleKey", "My English text.");
            backend.AddTranslation("de", "translation", "exampleKey", "Mein deutscher text.");

            _backend = backend;
        }
Example #2
0
        public async Task AddTranslation_AlterExistingEntry_TranslationShouldBeAltered()
        {
            _backend.AddTranslation("de", "test", "Value2", "Altered translated value");

            var tree = await _backend.LoadNamespaceAsync("de", "test");

            tree.Should().NotBeNull();

            var value = tree.GetValue("Value2", null);

            value.Should().Be("Altered translated value");
        }
Example #3
0
        public async Task AddTranslation_NewTranslation_TranslationShouldBeAdded()
        {
            _backend.AddTranslation("fr", "test", "ValueX", "New translated value");

            var tree = await _backend.LoadNamespaceAsync("fr", "test");

            tree.Should().NotBeNull();

            var value = tree.GetValue("ValueX", null);

            value.Should().Be("New translated value");
        }
Example #4
0
        public void SetUp()
        {
            _backend = new InMemoryBackend();

            _backend.AddTranslation("en-US", "test", "Value1", "Translated value 1");
            _backend.AddTranslation("en-US", "test", "Value2", "Translated value 2");
            _backend.AddTranslation("en-US", "test", "SectionA.Value1", "Translated section value 1");
            _backend.AddTranslation("en-US", "test", "SectionA.Value2", "Translated section value 2");

            _backend.AddTranslation("de", "test", "Value1", "Translated value 1");
            _backend.AddTranslation("de", "test", "Value2", "Translated value 2");
            _backend.AddTranslation("de", "test", "SectionA.Value1", "Translated section value 1");
            _backend.AddTranslation("de", "test", "SectionA.Value2", "Translated section value 2");
        }