Visual Studio 2012 - Unit Test Error

I am using Visual Studio 2012 and I get the following error: "Error" hw02.World "does not contain a constructor that takes 2 arguments. I am trying to create a unit test for my class:

class World : IWorld
{

    public World(int width, int height)
    {
        Width = width;
        Height = height;
        world = new IBuilding[width, height];
    }
}

Test that creates an error:

[TestClass]
public class UnitTest1
{
    [TestMethod]
    public void TestMethod1()
    {
        var world = new World(5, 5); // this line creates the error: 'hw02.World' does not contain a constructor that takes 2 arguments
    }
}

Thanks for any help

+4
source share
1 answer

World - ( Public ), unit test , InternalsVisibleTo, unit test , , , ( ).

. .

class World a public class World, InternalsVisibleTo , World.

+4

Source: https://habr.com/ru/post/1533395/


All Articles