Posts

Showing posts from February, 2019

unit test for plugin

using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Text; using Microsoft.Xrm.sdk; using System.ServiceModel; [TestClass] public class UnitTestPostOperation : UnitTestBase {     [TestMethod]     public void UnitTestMethod()     {         using (ShimsContext.Create())         {             string inData = "[{\"Key\":\"GuidId\",\"Value\":\"" + Guid.NewGuid().ToString() + "\"}]";             string inData = "{\"GuidId\",\"" + Guid.NewGuid().ToString() + "\"}]";             Entity target = new Entity("EntityName", Guid.NewGuid());             target["FieldName"] = new OptionSetValue(1);             target.FormattedValues["FieldName"] = "abc";             target.Attribute.Add("fieldName", new OptionSetValue(1));             Entity entityName = new Entity("EntityName", Guid.Ne