K720
K720

Reputation: 17

Assert Method Error

I am using the line Assert.IsNotNull(object); in my code. I keep getting the error:

the name assert does not exist in the current content

Can someone please tell me what I'm missing?

Upvotes: 1

Views: 2075

Answers (2)

Tudor
Tudor

Reputation: 62469

You need to add Microsoft.VisualStudio.QualityTools.UnitTestFramework to your project references and add

using Microsoft.VisualStudio.TestTools.UnitTesting;

Upvotes: 4

Jon Skeet
Jon Skeet

Reputation: 1503859

Is sounds like you don't have an appropriate using directive, such as

using NUnit.Framework;

in your code. The exact directive will depend on which unit testing framework you're using, of course. I'd expect you to get the same problem for other things though - particularly [Test] attributes etc.

Upvotes: 4

Related Questions