コード例 #1
0
        public void WorkItemNativePropertiesShouldBeAccessedAsSuch()
        {
            var workItem = new ShimWorkItem();

            workItem.TitleGet = () => "Title";
            workItem.DescriptionGet = () => "Description";

            dynamic workItemWrapper = new WorkItemModel(workItem);

            Assert.AreEqual("Title", workItemWrapper.Title);
            Assert.AreEqual("Description", workItemWrapper.Description);
        }
コード例 #2
0
        public void WorkItemTemplatePropertiesShouldBeAccessedAsNativeProperties()
        {
            var workItem = new ShimWorkItem();

            var fieldCollectionFake = new ShimFieldCollection();

            fieldCollectionFake.Bind(new Field[]
            {
                new ShimField()
                {
                    NameGet = () => "CustomField",
                    ValueGet = () => "CustomValue"
                }
            });

            workItem.FieldsGet = () => fieldCollectionFake;

            dynamic workItemWrapper = new WorkItemModel(workItem);

            Assert.AreEqual("CustomValue", workItemWrapper.CustomField);
        }