示例#1
0
            public void SetResourceAsItemType()
            {
                var editor = new ImageUriEditor(new Window());

                var value = editor.EditValue(context, serviceProvider.Object, "image://");

                Assert.Equal("Resource", (string)item.Data.ItemType);
            }
示例#2
0
            public void ReturnUriForComponent()
            {
                var editor = new ImageUriEditor(new Window());

                var value = editor.EditValue(context, serviceProvider.Object, "image://");

                Assert.Equal("pack://application:,,,/project;component/assets/icon.ico", value);
            }
示例#3
0
            public void ItemTypeIsUnchanged()
            {
                item.Data.ItemType = "None";
                var editor = new ImageUriEditor(new Window());

                var value = editor.EditValue(context, serviceProvider.Object, "image://");

                Assert.Equal("None", (string)item.Data.ItemType);
            }
示例#4
0
            public void CustomToolIsUnchanged()
            {
                item.Data.CustomTool = "MyTool";
                var editor = new ImageUriEditor(new Window());

                var value = editor.EditValue(context, serviceProvider.Object, "image://");

                Assert.Equal("MyTool", (string)item.Data.CustomTool);
            }
示例#5
0
            public void WhenCancelDialog_ThenReturnPreviousValue()
            {
                var editor = new ImageUriEditor(new Window());

                picker.Setup(p => p.ShowDialog()).Returns(false);

                var value = editor.EditValue(context, serviceProvider.Object, "image://");

                Assert.Equal("image://", value);
            }