コード例 #1
0
        public void UpdateIndexListData()
        {
            UpdateIndexListDataDirective.AddSupport();
            var dir             = Utility.ExampleFileContent <IDirective>("UpdateIndexListData.json");
            var updateDirective = Assert.IsType <UpdateIndexListDataDirective>(dir);

            Assert.Equal(5, updateDirective.Operations.Count);
            var ii = Assert.IsType <InsertItem>(updateDirective.Operations[0]);

            Assert.Equal(10, ii.Index);

            var imi = Assert.IsType <InsertMultipleItems>(updateDirective.Operations[1]);

            Assert.Equal(12, imi.Index);
            Assert.Equal(3, imi.Items.Length);

            var si = Assert.IsType <SetItem>(updateDirective.Operations[2]);

            Assert.Equal(14, si.Index);
            Assert.NotNull(si.Item);

            var di = Assert.IsType <DeleteItem>(updateDirective.Operations[3]);

            Assert.Equal(16, di.Index);

            var dmi = Assert.IsType <DeleteMultipleItems>(updateDirective.Operations[4]);

            Assert.Equal(17, dmi.Index);
            Assert.Equal(2, dmi.Count);

            Assert.True(Utility.CompareJson(updateDirective, "UpdateIndexListData.json"));
        }
コード例 #2
0
 public static void Add()
 {
     RenderDocumentDirective.AddSupport();
     ExecuteCommandsDirective.AddSupport();
     SendIndexListDataDirective.AddSupport();
     UpdateIndexListDataDirective.AddSupport();
     new UserEventRequestHandler().AddToRequestConverter();
     new LoadIndexListDataRequestHandler().AddToRequestConverter();
     new RuntimeErrorRequestHandler().AddToRequestConverter();
 }