Example #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);
            }
Example #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);
            }
Example #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);
            }
Example #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);
            }
Example #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);
            }