title: Unit testing "object reference not set to an instance " at NUnit
body: <p>i have a ASP.Net project and Nunitasp framework work for unit testing,i have a object in account.aspx.cs file when i tried to test the object(NugetplatformModel) value i get"object reference not set to an instance" error, 
  my account page code is given below</p>
  
  <pre><code> public partial class Account : System.Web.UI.Page
  {
      public NugetPlatformModel NugetPlatformModels;
      public string result = string.Empty;
  
      protected void Page_Load(object sender, EventArgs e)
      {
  
          if (!WebSecurity.IsAuthenticated)
          {
              Response.Redirect("/login", true);
          }
          else
          {
              result = "success";
              NugetPlatformModels = new NugetPlatformModel();
          }
  </code></pre>
  
  <p>}</p>
  
  <p>my test case code is given below</p>
  
  <pre><code>        [Test]
      public void AccountPage_ValidCredential_AccessModel()
      {
          Browser.GetPage(domain + "account");
          string ExpectedPage = domain + "account";
          logon();
          Account acccountPage = new Account();
          AssertEquals("success", acccountPage.result);
          AssertEquals("should have license",true,acccountPage.NugetPlatformModels.IsHavingLicense);
  
      }
  </code></pre>
  
  <p>How can I access and test that code behind variables? when start the testing the NUgetplatformmodel has been assigned i have checked it by debugging but after that in nunit gui it displays null reference error, i thought there is a problem in accessing variable in testcase..please help me..</p>