public void DataListConversionUtilTest_CreateListToBindTo_WhenColumnHasInputMapping_ExpectCollectionWithOneItem()
        {
            //------------Setup for test--------------------------
            var converter = new DataListConversionUtils();

            const string Data = "<DataList></DataList>";
            const string Shape = @"<DataList><rec Description="""" IsEditable=""True"" ColumnIODirection=""None"" ><a Description="""" IsEditable=""True"" ColumnIODirection=""Input"" /><b Description="""" IsEditable=""True"" ColumnIODirection=""None"" /></rec></DataList>";

            //------------Execute Test---------------------------
            var bdl = new DataListModel();
            bdl.Create(Data, Shape);
            var result = converter.CreateListToBindTo(bdl);

            //------------Assert Results-------------------------
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("rec", result[0].Recordset);
            Assert.AreEqual("a", result[0].Field);
        }
        // ReSharper disable InconsistentNaming
        public void DataListConversionUtilTest_CreateListToBindTo_WhenColumnHasBothMapping_ExpectCollectionWithOneItem()
        // ReSharper restore InconsistentNaming
        {
            //------------Setup for test--------------------------
            var converter = new DataListConversionUtils();
            var compiler = DataListFactory.CreateDataListCompiler();
            ErrorResultTO errors;

            const string Data = "<DataList></DataList>";
            const string Shape = @"<DataList><rec Description="""" IsEditable=""True"" ColumnIODirection=""None"" ><a Description="""" IsEditable=""True"" ColumnIODirection=""Both"" /><b Description="""" IsEditable=""True"" ColumnIODirection=""None"" /></rec></DataList>";

            //------------Execute Test---------------------------
            var dlId = compiler.ConvertTo(DataListFormat.CreateFormat(GlobalConstants._Studio_Debug_XML), Data.ToStringBuilder(), Shape.ToStringBuilder(), out errors);
            var bdl = compiler.FetchBinaryDataList(dlId, out errors);

            var result = converter.CreateListToBindTo(bdl);

            //------------Assert Results-------------------------
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("rec", result[0].Recordset);
            Assert.AreEqual("a", result[0].Field);

        }
        public WorkflowInputDataViewModel(IServiceDebugInfoModel input, Guid sessionId)
        {
            VerifyArgument.IsNotNull("input", input);
            CanDebug = true;
            CanViewInBrowser = true;

            DebugTo = new DebugTO
            {
                DataList = !string.IsNullOrEmpty(input.ResourceModel.DataList)
                               ? input.ResourceModel.DataList
                               : "<DataList></DataList>",
                ServiceName = input.ResourceModel.ResourceName,
                WorkflowID = input.ResourceModel.ResourceName,
                WorkflowXaml = string.Empty,
                //WorkflowXaml = input.ResourceModel.WorkflowXaml, - 05.12.2013 ;)
                XmlData = input.ServiceInputData,
                ResourceID = input.ResourceModel.ID,
                ServerID = input.ResourceModel.ServerID,
                RememberInputs = input.RememberInputs,
                SessionID = sessionId
            };

            if(input.DebugModeSetting == DebugMode.DebugInteractive)
            {
                DebugTo.IsDebugMode = true;
            }

            _resourceModel = input.ResourceModel;
            // ReSharper disable DoNotCallOverridableMethodsInConstructor
            DisplayName = "Debug input data";
            // ReSharper restore DoNotCallOverridableMethodsInConstructor
            _dataListConversionUtils = new DataListConversionUtils();
        }
        // ReSharper disable InconsistentNaming
        public void DataListConversionUtilTest_CreateListToBindTo_WhenScalarHasInputMapping_ExpectCollectionWithOneItem()
        // ReSharper restore InconsistentNaming
        {
            //------------Setup for test--------------------------
            var converter = new DataListConversionUtils();

            const string Data = "<DataList></DataList>";
            const string Shape = @"<DataList><scalar Description="""" IsEditable=""True"" ColumnIODirection=""Input"" ></scalar></DataList>";

            //------------Execute Test---------------------------
            var bdl = new DataListModel();
            bdl.Create(Data, Shape);
            var result = converter.CreateListToBindTo(bdl);

            //------------Assert Results-------------------------
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("scalar", result[0].Field);

        }
        public void DataListConversionUtilTest_CreateListToBindTo_WhenScalarHasNoneMapping_ExpectCollectionWithNoItems()
        {
            //------------Setup for test--------------------------
            var converter = new DataListConversionUtils();

            const string Data = "<DataList></DataList>";
            const string Shape = @"<DataList><scalar Description="""" IsEditable=""True"" ColumnIODirection=""None"" ></scalar></DataList>";

            //------------Execute Test---------------------------
            var bdl = new DataListModel();
            bdl.Create(Data, Shape);
            var result = converter.CreateListToBindTo(bdl);

            //------------Assert Results-------------------------
            Assert.AreEqual(0, result.Count);
        }