title: Unit testing CRUD operation in visual studio 2012
body: <p>I am testing the create class in Visual Studio 2012 </p>
  
  <p>My controller class is:</p>
  
  <pre><code>  public ActionResult Create()
      {
          return View();
      }
  
      //
      // POST: /Member/Create
  
      [HttpPost]
      public ActionResult Create(Member member)
      {
          if (ModelState.IsValid)
          {
              db.Members.Add(member);
              db.SaveChanges();
              return RedirectToAction("Index");
          }
  
          return View(member);
      }
  </code></pre>
  
  <p>And test class is:</p>
  
  <pre><code>[TestClass]
  public class MemberTest
  {
  
      [TestMethod]
      public void Create(Member mem)
      {
          mem.MemID = 123;
          mem.MemName = "sruthy";
  
  
          /// dont know what is writing.
  
      }
  }
  </code></pre>
  
  <p>SampleDataContext.cs</p>
  
  <pre><code>public class SampleDataContext:DbContext
  {
      public DbSet&lt;Member&gt; Members { get; set; }
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
      }
  }
  </code></pre>
  
  <p>I am stuck in test case please help me.</p>