public virtual void Test()
		{
			MockBin mock = new MockBin();
			BinConfiguration binConfig = new BinConfiguration("uri", true, 42L, false);
			IBin storage = new NonFlushingStorage(new _IStorage_19(mock)).Open(binConfig);
			byte[] buffer = new byte[5];
			storage.Read(1, buffer, 4);
			storage.Write(2, buffer, 3);
			mock.ReturnValueForNextCall(42);
			Assert.AreEqual(42, mock.Length());
			storage.Sync();
			storage.Close();
			mock.Verify(new MethodCall[] { new MethodCall("open", new object[] { binConfig })
				, new MethodCall("read", new object[] { 1L, buffer, 4 }), new MethodCall("write"
				, new object[] { 2L, buffer, 3 }), new MethodCall("length", new object[] {  }), 
				new MethodCall("close", new object[] {  }) });
		}
Example #2
0
        public virtual void Test()
        {
            MockBin          mock      = new MockBin();
            BinConfiguration binConfig = new BinConfiguration("uri", true, 42L, false);
            IBin             storage   = new NonFlushingStorage(new _IStorage_19(mock)).Open(binConfig);

            byte[] buffer = new byte[5];
            storage.Read(1, buffer, 4);
            storage.Write(2, buffer, 3);
            mock.ReturnValueForNextCall(42);
            Assert.AreEqual(42, mock.Length());
            storage.Sync();
            storage.Close();
            mock.Verify(new MethodCall[] { new MethodCall("open", new object[] { binConfig })
                                           , new MethodCall("read", new object[] { 1L, buffer, 4 }), new MethodCall("write"
                                                                                                                    , new object[] { 2L, buffer, 3 }), new MethodCall("length", new object[] {  }),
                                           new MethodCall("close", new object[] {  }) });
        }
			public _IStorage_19(MockBin mock)
			{
				this.mock = mock;
			}
Example #4
0
 public _IStorage_19(MockBin mock)
 {
     this.mock = mock;
 }