public void PartialData() { var entity = new Entity("contact", Guid.NewGuid()) { ["firstname"] = "рОМАН", ["middlename"] = "анатольевич" }; IPluginExecutionContext context = new FakePluginExecutionContext(entity); IServiceProvider serviceProvider = new FakeServiceProvider(context); var plugin = new ToTitleCase(CONFIG_STR); plugin.Execute(serviceProvider); var result = context.GetContextEntity(); Assert.AreEqual("Роман", result.GetAttributeValue <string>("firstname")); Assert.IsNull(result.GetAttributeValue <string>("lastname")); Assert.AreEqual("Анатольевич", result.GetAttributeValue <string>("middlename")); }
public void SimpleData() { var entity = new Entity("contact", Guid.NewGuid()) { ["firstname"] = "РОМАН", ["lastname"] = "копаев-ЗаДуНайский", ["middlename"] = "анатольевич" }; IPluginExecutionContext context = new FakePluginExecutionContext(entity); IServiceProvider serviceProvider = new FakeServiceProvider(context); var plugin = new ToTitleCase(CONFIG_STR); plugin.Execute(serviceProvider); var result = context.GetContextEntity(); Assert.AreEqual("Роман", result["firstname"]); Assert.AreEqual("Копаев-Задунайский", result["lastname"]); Assert.AreEqual("Анатольевич", result["middlename"]); }