lundi 23 novembre 2015

Type Expected in simple unit test

I'm getting an error in a very simple vb.net unit test and I can't understand why. The code is as follows:

Imports InvestorsEdge.AtlasDAL

<TestClass()> Public Class AtlasConnector_Tests
    <TestMethod()> Public Sub AtlasConnector_New()
        Dim c1 = New AtlasConnector("1")
        Dim c2 = New InvestorsEdge.AtlasDAL.AtlasConnector("1")
        Assert.IsTrue(c1.DataDirectory = "1" And Not IsNothing(c1.Db))
    End Sub
End Class

The error I get is on the Dim c1... - the IDE puts a red error underline on AtlasConnector with an error of "Type expected". The second line initialising c2 works perfectly.

I have other more complex unit tests in other files that refer to different objects in the same library and they work fine, both in their own files and when I copy and paste the subs into this file.

Why does the fully qualified name work but the other one doesn't?

Aucun commentaire:

Enregistrer un commentaire