Ejemplo n.º 1
0
        public void Dispose_Disposes_CurrentValue()
        {
            var sourceMock     = CreateMock <IDataSource <IDisposable> >();
            var disposableMock = CreateMock <IDisposable>();
            var dataSource     = new TestableDataSourceProcessor <IDisposable, IDisposable>(sourceMock.Object, (d) => d);

            sourceMock.Setup(m => m.Dispose());
            disposableMock.Setup(m => m.Dispose());

            dataSource.SetValue(disposableMock.Object);

            dataSource.Dispose();
        }
Ejemplo n.º 2
0
 public override void Setup()
 {
     base.Setup();
     this.dataSourceMock = CreateMock <IDataSource <int> >();
     this.dataSource     = new TestableDataSourceProcessor <string, int>(dataSourceMock.Object, (i) => i.ToString());
 }