Exemple #1
0
        public void GetValueCallsRowsGetValueWithTheBinding()
        {
            IDataItem item = Mocks.StrictMock <IDataItem>();

            DataBinding binding = new DataBinding(0, null);

            using (Mocks.Record())
            {
                Expect.Call(item.GetValue(binding)).Return(42);
            }

            using (Mocks.Playback())
            {
                BoundDataAccessor accessor = new BoundDataAccessor(binding);
                Assert.AreEqual(42, accessor.GetValue(item));
            }
        }
Exemple #2
0
        public void GetValueThrowsIfItemIsNull()
        {
            BoundDataAccessor accessor = new BoundDataAccessor(new DataBinding(0, null));

            Assert.Throws <ArgumentNullException>(delegate { accessor.GetValue(null); });
        }