Exemplo n.º 1
0
        public void SnippetLibrary_Remove()
        {
            List<string> s1Content = new List<string>()
            {
                "lorem ipsum dot sit amet,",
                "consectetur adipisicing elit"
            };
            Snippet s1 = new Snippet("lorem", s1Content);
            List<string> s2Content = new List<string>()
            {
                "if ()",
                "{",
                "",
                "}"
            };
            Snippet s2 = new Snippet("if", s2Content);

            snippetLibrary.Add(s1);
            snippetLibrary.Add(s2);
            this.snippetLibrary = null;
            this.snippetLibrary = new SnippetLibrary();
            this.snippetLibrary.Remove("lorem");
            Assert.IsNull(this.snippetLibrary.GetByName("lorem"));
            Assert.AreEqual(1, this.snippetLibrary.Names.Count);
        }
Exemplo n.º 2
0
 public void SnippetLibrary_Add()
 {
     List<string> s1Content = new List<string>()
     {
         "lorem ipsum dot sit amet,",
         "consectetur adipisicing elit"
     };
     Snippet s1 = new Snippet("lorem", s1Content);
     snippetLibrary.Add(s1);
     this.snippetLibrary = null;
     this.snippetLibrary = new SnippetLibrary();
     Assert.IsNotNull(this.snippetLibrary.GetByName("lorem"));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SnippetLibraryWindow"/> class.
 /// </summary>
 /// <param name="snippetLibrary">The library.</param>
 public SnippetLibraryWindow(SnippetLibrary snippetLibrary)
 {
     this.snippetLibrary = snippetLibrary;
     this.InitializeComponent();
     this.snippetsListBox.ItemsSource = this.snippetLibrary.Names;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SnippetLibraryAddNewWindow"/> class.
 /// </summary>
 /// <param name="snippetLibrary">SnippetLibrary to add new snippet.</param>
 public SnippetLibraryAddNewWindow(SnippetLibrary snippetLibrary)
 {
     this.snippetLibrary = snippetLibrary;
     this.InitializeComponent();
 }
Exemplo n.º 5
0
 public void setUp()
 {
     this.snippetLibrary = new SnippetLibrary();
     this.snippetLibrary.RemoveAll();
 }