title: C# - Unit testing Factory Design Pattern
body: <p>I'm working on a project and I have to Unit Test a Factory Design pattern in C#.
  Currently im stuck and I have no idea what I have too do. Can someone help me out? I want to Unit Test this code:</p>
  
  <pre><code>public class CinemaFactory : AbstractFactory //inheritance of AbstractFactory
  {
      public override Space createspace(AddItemsInProps item)
      {
          //returns new Cinema
          return new Cinema(item.AreaType, item.Position, item.Dimension); 
      }
  }
  </code></pre>
  
  <p>I also made a Unit test project and created this:</p>
  
  <pre><code>    [TestClass]
  public class UnitTest1
  {
      [TestMethod]
      public void TestMethod1()
      {
          //Arrange
          Game1.Design_Patterns.CinemaFactory cinemaFactory = new Game1.Design_Patterns.CinemaFactory();
  
          //Act
  
          //Assert
  
      }
  }
  </code></pre>
  
  <p>Cinema:</p>
  
  <pre><code>public class Cinema : Space //inheritance of Space class
  {
  
      //Named arguments free you from the need to remember or to look up the order of parameters in the parameter lists of called methods. 
      public Cinema(string areaType, string position, string dimension) : base(areaType, position, dimension)
      {
          //The sprite  of the Cinema
          this.Img = "cinema";
      }
      public void StartMovie()
      {
  
      }
  }
  </code></pre>
  
  <p>This is de class AddItemsInProps:</p>
  
  <pre><code>public class AddItemsInProps
  {
      //Get: The get { } implementation must include a return statement. It can access any member on the class.
      //Set: The set { } implementation receives the implicit argument "value." This is the value to which the property is assigned.
  
          public string Classification { get; set; }
          public string AreaType { get; set; }
          public string Position { get; set; }
          public string Dimension { get; set; }
          public int Capacity { get; set; }
          public int ID { get; set; }
      }
  }
  </code></pre>
  
  <p>This is de class Space:</p>
  
  <pre><code> public abstract class Space
  {
      public string AreaType { get; set; }
      public Point Position { get; set; }
      public Point Dimension { get; set; }
      public int ID { get; set; }
      public string Img { get; set; }
      public int Afstand { get; set; }
      public Space Vorige { get; set; }
      public Dictionary&lt;Space, int&gt; Neighbours = new Dictionary&lt;Space, int&gt;();
  </code></pre>
  
  <p>This is de class AbstractFactory:</p>
  
  <pre><code>    public abstract class AbstractFactory
  {
      //Creating Object
      public abstract Space createspace(AddItemsInProps item);
  }
  </code></pre>