/// <exception cref="System.NotSupportedException"></exception> /// <exception cref="NGit.Errors.TransportException"></exception> private PushResult TestOneUpdateStatus(RemoteRefUpdate rru, Ref advertisedRef, RemoteRefUpdate.Status expectedStatus, bool?fastForward) { refUpdates.AddItem(rru); if (advertisedRef != null) { advertisedRefs.AddItem(advertisedRef); } PushResult result = ExecutePush(); NUnit.Framework.Assert.AreEqual(expectedStatus, rru.GetStatus()); if (fastForward != null) { NUnit.Framework.Assert.AreEqual(fastForward.Value, rru.IsFastForward()); } return(result); }
public virtual void TestUpdateMixedCases() { RemoteRefUpdate rruOk = new RemoteRefUpdate(db, (string)null, "refs/heads/master" , false, null, null); Ref refToChange = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, "refs/heads/master", ObjectId.FromString("2c349335b7f797072cf729c4f3bb0914ecb6dec9")); RemoteRefUpdate rruReject = new RemoteRefUpdate(db, (string)null, "refs/heads/nonexisting" , false, null, null); refUpdates.AddItem(rruOk); refUpdates.AddItem(rruReject); advertisedRefs.AddItem(refToChange); ExecutePush(); NUnit.Framework.Assert.AreEqual(RemoteRefUpdate.Status.OK, rruOk.GetStatus()); NUnit.Framework.Assert.AreEqual(true, rruOk.IsFastForward()); NUnit.Framework.Assert.AreEqual(RemoteRefUpdate.Status.NON_EXISTING, rruReject.GetStatus ()); }
/// <exception cref="System.NotSupportedException"></exception> /// <exception cref="NGit.Errors.TransportException"></exception> private PushResult TestOneUpdateStatus(RemoteRefUpdate rru, Ref advertisedRef, RemoteRefUpdate.Status expectedStatus, bool? fastForward) { refUpdates.AddItem(rru); if (advertisedRef != null) { advertisedRefs.AddItem(advertisedRef); } PushResult result = ExecutePush(); NUnit.Framework.Assert.AreEqual(expectedStatus, rru.GetStatus()); if (fastForward != null) { NUnit.Framework.Assert.AreEqual(fastForward.Value, rru.IsFastForward()); } return result; }
public virtual void TestUpdateMixedCases() { RemoteRefUpdate rruOk = new RemoteRefUpdate(db, (string)null, "refs/heads/master" , false, null, null); Ref refToChange = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, "refs/heads/master", ObjectId.FromString("2c349335b7f797072cf729c4f3bb0914ecb6dec9")); RemoteRefUpdate rruReject = new RemoteRefUpdate(db, (string)null, "refs/heads/nonexisting" , false, null, null); refUpdates.AddItem(rruOk); refUpdates.AddItem(rruReject); advertisedRefs.AddItem(refToChange); ExecutePush(); NUnit.Framework.Assert.AreEqual(RemoteRefUpdate.Status.OK, rruOk.GetStatus()); NUnit.Framework.Assert.AreEqual(true, rruOk.IsFastForward()); NUnit.Framework.Assert.AreEqual(RemoteRefUpdate.Status.NON_EXISTING, rruReject.GetStatus ()); }