method used like a type error in a unit test
- by Josepth Vodary
I am trying to unit test a simple factory - but it keeps telling me that I am trying to use a method like a type?
My unit test
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Home;
namespace HomeTest
{
[TestClass]
public class TestFactory
{
[TestMethod]
public void DoTestFactory()
{
InventoryType.InventorySelect select = new InventoryType.InventorySelect();
select.inventoryTypes.Add("cds");
Home.Services.Factory.CreateInventory get = new Home.Services.Factory.CreateInventory();
get.InventoryImpl();
if (select.Validate() == true)
Console.WriteLine("Test Passed");
else
if (select.Validate() == false)
Console.WriteLine("Test Returned False");
else
Console.WriteLine("Test Failed To Run");
Console.ReadLine();
}
}
}
My facotry
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Home.Services
{
public class Factory
{
public InventorySvc CreateInventory()
{
return new InventoryImpl();
}
}
}