Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using NUnit.Framework;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Delegates.Observers
  9. {
  10.     [TestFixture]
  11.     public class ObservableStack_Tests
  12.     {
  13.         [Test]
  14.         public void Log_ShouldBeEmpty_AfterCreation()
  15.         {
  16.             var stack = new ObservableStack<int>();
  17.             var helper = new StackOperationsLogger();
  18.             helper.SubscribeOn(stack);
  19.             Assert.AreEqual("", helper.GetLog());
  20.         }
  21.  
  22.         [Test]
  23.         public void Log_ShouldContainAllOperations()
  24.         {
  25.             var stack = new ObservableStack<int>();
  26.             var helper = new StackOperationsLogger();
  27.             helper.SubscribeOn(stack);
  28.             stack.Push(1);
  29.             stack.Push(2);
  30.             stack.Pop();
  31.             stack.Push(10);
  32.             Assert.AreEqual("+1+2-2+10", helper.GetLog());
  33.  
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement