public void translated_fields_should_fallback_to_french_when_the_ui_is_english_and_the_value_is_empty() { // Arrange var context = new XrmFakedContext(); var pluginContext = context.GetDefaultPluginContext(); var topic = new opc_topic { opc_theme_topics_themeid = new opc_theme { opc_name = $"{Prefix}{Separator}Informatique" } }; pluginContext.OutputParameters.Add(OutputParameter.BusinessEntity, topic); pluginContext.MessageName = PluginMessage.Retrieve; pluginContext.SharedVariables.Add(LanguageKey, (int)Language.English); // Act context.ExecutePluginWith <MultiLanguagePlugin>(pluginContext); // Assert var expected = "Informatique"; topic.opc_theme_topics_themeid.opc_name.Should().Be(expected); }
public void translated_fields_should_be_french_when_ui_is_french() { // Arrange var context = new XrmFakedContext(); var pluginContext = context.GetDefaultPluginContext(); var topic = new opc_topic { opc_themeid = new EntityReference { Name = $"{Prefix}Technology{Separator}Technologie" } }; pluginContext.OutputParameters.Add(OutputParameter.BusinessEntity, topic); pluginContext.MessageName = PluginMessage.Retrieve; pluginContext.SharedVariables.Add(LanguageKey, (int)Language.French); // Act context.ExecutePluginWith <MultiLanguagePlugin>(pluginContext); // Assert var expected = "Technologie"; topic.opc_themeid.Name.Should().Be(expected); }