Ejemplo n.º 1
0
 public void Should_Return_Item()
 {
     var clipboard = new Clipboard();
     var item = MockRepository.Mock<ICliboardable>();
     clipboard.Item = item;
     Assert.IsNotNull((clipboard.Item));
     Assert.AreEqual(clipboard.Item,item);
 }
Ejemplo n.º 2
0
        public void Should_Raise_ItemChanged()
        {
            var eventRaised = false;
            var clipboard = new Clipboard();
            clipboard.ItemChanged += (s, e) => eventRaised = true;
            var item = MockRepository.Mock<ICliboardable>();
            clipboard.Item = item;

            Assert.AreEqual(eventRaised,true);
        }
Ejemplo n.º 3
0
 public void Should_Call_On_Item_Removed()
 {
     var clipboard = new Clipboard();
     var item = MockRepository.Mock<ICliboardable>();
     item.Stub(x => x.OnClipboardRemove()).Repeat.Once();
     clipboard.Item = item;
     var seconditem = MockRepository.Mock<ICliboardable>();
     clipboard.Item = seconditem;
     item.VerifyAllExpectations();
 }
Ejemplo n.º 4
0
 public void If_The_Same_Value_Do_Nothing()
 {
     var eventRaised = false;
     var clipboard = new Clipboard();
     var item = MockRepository.Mock<ICliboardable>();
     item.Stub(x => x.OnClipboardRemove()).Repeat.Times(0);
     clipboard.Item = item;
     clipboard.ItemChanged += (s, e) => eventRaised = true;
     clipboard.Item = item;
     item.VerifyAllExpectations();
     Assert.AreEqual(eventRaised,false);
 }
Ejemplo n.º 5
0
 public void Clipboard_Should_Return_Null()
 {
     var clipboard = new Clipboard();
        var item = clipboard.Item;
     Assert.IsNull(item);
 }