Exemplo n.º 1
0
        public void ShouldNotDeploy_CSOM_ListItemFieldValue_WithFieldId()
        {
            var hasException = false;

            var def = new ListItemFieldValueDefinition
            {
                FieldId = BuiltInFieldId.Title,
                Value   = Rnd.String()
            };

            try
            {
                var handler = new SPMeta2.CSOM.ModelHandlers.ListItemFieldValueModelHandler();

                handler.DeployModel(null, def);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetType() == typeof(SPMeta2NotSupportedException));
                Assert.IsTrue(ex.Message.Contains("ListItemFieldValueDefinition.FieldId"));

                hasException = true;
            }

            Assert.IsTrue(hasException);
        }
        public void ShouldNotDeploy_CSOM_ListItemFieldValue_WithFieldId()
        {
            var hasException = false;

            var def = new ListItemFieldValueDefinition
            {
                FieldId = BuiltInFieldId.Title,
                Value = Rnd.String()
            };

            try
            {
                var handler = new SPMeta2.CSOM.ModelHandlers.ListItemFieldValueModelHandler();

                handler.DeployModel(null, def);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetType() == typeof(SPMeta2NotSupportedException));
                Assert.IsTrue(ex.Message.Contains("ListItemFieldValueDefinition.FieldId"));

                hasException = true;
            }

            Assert.IsTrue(hasException);
        }