public void WhenShortcutFileHasShortcut_ThenReadShortcutReturns() { var shortcut = new ShortcutFileHandler(this.PathTo(@"Runtime.IntegrationTests.Content\Shortcuts\ValidShortcut.shortcut")).ReadShortcut(); Assert.NotNull(shortcut); Assert.Equal("custom", shortcut.Type); Assert.Equal("somedescription", shortcut.Description); Assert.Equal(2, shortcut.Parameters.Count); Assert.Equal("foo", shortcut.Parameters.First().Key); Assert.Equal("bar", shortcut.Parameters.First().Value); }
public void WhenValidShortcutWrittenAndRead_ThenReadShortcutReturns() { var handler = new ShortcutFileHandler(this.PathTo(@"Runtime.IntegrationTests.Content\Shortcuts\NewShortcut.shortcut")); var shortcut = new Shortcut { Type = "custom", Description = "somedescription", }; shortcut.Parameters.Add("foo", "bar"); handler.WriteShortcut(shortcut); Assert.True(File.Exists(handler.FilePath)); var loadedShortcut = handler.ReadShortcut(); Assert.NotNull(loadedShortcut); Assert.Equal("custom", loadedShortcut.Type); Assert.Equal("somedescription", loadedShortcut.Description); Assert.Equal(1, loadedShortcut.Parameters.Count); Assert.Equal("foo", loadedShortcut.Parameters.First().Key); Assert.Equal("bar", loadedShortcut.Parameters.First().Value); }