views:

37

answers:

0

Hi,

Can you help with the problem which i'm currently facing?

We've created ASP.NET MVC application with "Out Proc" seesion state managment. We are using strong type session in our control class.

Here sample code FYR..

Public Class CustomerController Inherits TxnProcess

TxnProcess -- this class extended by another class which is actually creating the session objects.

<Serializable()> _
Partial Public Class WebSession
    Implements IDisposable

---- Sample code in CustomerController to which i want to create unit test.

Function AddPreviousOwnerDetails() As ActionResult
        Try
            oTxnObj = WebSession.GetTransactionFromDictionary(WebSession.ActiveTransaction)
            If oTxnObj.Vehicle.PurchaseType = Constants.FLD_IsDLorVI_1 Then
                WebSession.AddTransactionToDictionary(WebSession.ActiveTransaction, oTxnObj)
                Return GetNextScreen(WebSession.ActiveTransaction)
            End If
            PageID = Request(Constants.STR_PAGEID)
            If oTxnObj.Customer.CustAddress Is Nothing Then
                oTxnObj.Customer.CustAddress = New CustomerAddress()
            End If
            If PageID Is Nothing Then
                ViewData(Constants.STR_LOADCONTROLNAME) = Constants.UC_PREVIOUSOWNER
                Return View(oTxnObj.PreviousOwner)
            End If
        Catch ex As Exception
            Throw ex
        End Try
        Return View(oTxnObj.PreviousOwner)

    End Function

I dont understand how to write unit test using VS 2008 for above sample code, can you please give me some code which can cover above scenario! using VB.NET

Thank you very much in adavnce

-- Venky