Example #1
0
        public virtual void TestIncorrectBaseSize()
        {
            Init(4, 4);
            Copy(0, 4);
            AssertValidState();
            DeltaStream @in = new _DeltaStream_204(this, new ByteArrayInputStream(delta));

            try
            {
                @in.Read(new byte[4]);
                NUnit.Framework.Assert.Fail("did not throw an exception");
            }
            catch (CorruptObjectException e)
            {
                NUnit.Framework.Assert.AreEqual(JGitText.Get().baseLengthIncorrect, e.Message);
            }
            @in = new _DeltaStream_222(new ByteArrayInputStream(delta));
            try
            {
                @in.Read(new byte[4]);
                NUnit.Framework.Assert.Fail("did not throw an exception");
            }
            catch (CorruptObjectException e)
            {
                NUnit.Framework.Assert.AreEqual(JGitText.Get().baseLengthIncorrect, e.Message);
            }
        }
Example #2
0
		public virtual void TestIncorrectBaseSize()
		{
			Init(4, 4);
			Copy(0, 4);
			AssertValidState();
			DeltaStream @in = new _DeltaStream_204(this, new ByteArrayInputStream(delta));
			try
			{
				@in.Read(new byte[4]);
				NUnit.Framework.Assert.Fail("did not throw an exception");
			}
			catch (CorruptObjectException e)
			{
				NUnit.Framework.Assert.AreEqual(JGitText.Get().baseLengthIncorrect, e.Message);
			}
			@in = new _DeltaStream_222(new ByteArrayInputStream(delta));
			try
			{
				@in.Read(new byte[4]);
				NUnit.Framework.Assert.Fail("did not throw an exception");
			}
			catch (CorruptObjectException e)
			{
				NUnit.Framework.Assert.AreEqual(JGitText.Get().baseLengthIncorrect, e.Message);
			}
		}