HI

I have install Nunit when i am running this nunit it gives me some error and the error i am getting is "This assembly was not built with any known testing framework":'( and in c# in reference i am adding the .net framework and in that i am not getting .dll file i have even browser an try to put from program files but it is not showing me in reference folder please let me know what i do in this case ?


When i am writing this code

using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
        }

        public float balance;
        public void Deposite(float amount)
        {
            balance += amount;
        }
        public void withdraw(float amount)
        {
            balance -= amount;
        }
        public void TransferFunds(Program destination, float amount)
        {
        }
        public float Balance
        {
            get
            {
                return balance;
            }
        }

        public static void testmethod()
        {
            Program a1 = new Program();
            a1.Deposite(200.00f);
            Program a2 = new Program();
            a2.Deposite(15.00f);
            a1.TransferFunds(a2, 100.00f);
            Program.Equals(250.00f, a2.balance);
            Program.Equals(100.00f, a1.balance);
        }
    }
    [TestFixture()]
       public class Calculator_UnitTest
       {

           Program a1 = new Program();

              [SetUp()]
              public void Init()
              {
                     // some code here, that need to be run
                     // at the start of every test case.
              }

              [TearDown()]
              public void Clean()
              {
                     // code that will be called after each Test case
              }

              [Test]
              public void Test()
{
    Program a1 = new Program();
    a1.Deposite(200.00f);
    Program a2 = new Program();
    a2.Deposite(15.00f);
    a1.TransferFunds(a2, 100.00f);
    Program.Equals(250.00f, a2.balance);
    Program.Equals(100.00f, a1.balance);

}
       }
}

its not supporting Nunit.framework nor [testFixture] and all please help:'(:'(:(

Recommended Answers

All 2 Replies

Try with adding NUnit.Extensions dll

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.