public static void TestCase_PromoterType()
{
string testCaseDescription = "TestCase_PromoterType";
Trace("**** " + testCaseDescription + " ****");
AutoResetEvent pspeCompleted = new AutoResetEvent(false);
NonMSDTCPromoterEnlistment pspe = null;
try
{
using (TransactionScope ts = new TransactionScope())
{
Assert.Equal(Guid.Empty, TxPromoterType(Transaction.Current));
pspe = (NonMSDTCPromoterEnlistment)CreatePSPEEnlistment(NonMsdtcPromoterTests.PromoterType1,
NonMsdtcPromoterTests.PromotedToken1,
pspeCompleted,
/*nonMSDTC = */ true,
/*tx = */ null,
/*spcResponse=*/ TransactionStatus.Committed,
/*expectRejection=*/ false
);
Assert.Equal(NonMsdtcPromoterTests.PromoterType1, TxPromoterType(Transaction.Current));
Promote(testCaseDescription, NonMsdtcPromoterTests.PromotedToken1);
Assert.Equal(NonMsdtcPromoterTests.PromoterType1, TxPromoterType(Transaction.Current));
ts.Complete();
}
}
catch (Exception ex)
{
Assert.Null(ex);
}
Assert.True(pspeCompleted.WaitOne(TimeSpan.FromSeconds(5)));
Assert.True(pspe.Promoted);
TestPassed();
}