I am supposed to write NUnit Test Cases for the below method. Can anyone tell me how do I assign a value for the below scenario?
[Test]
public void method_Test()
{
Animal animal = null; //how to assign the value?
bool isHerbivore = false;
CategorizeAnimal ca = new CategorizeAnimal(animal,isHerbivore); // TODO: Initialize to an appropriate value
int expected = 0; // TODO: Initialize to an appropriate value
int actual;
actual = ca.getProcedureDuration();
NUnit.Framework.Assert.AreEqual(expected, actual);
NUnit.Framework.Assert.Inconclusive("Verify the correctness of this test method.");
}
public class Animal
{
[DataMember]
public int numOfLegs;
[DataMember]
public EnumValue color;
}
The question is:
How do I assign a value for the object animal?
Please Help :)
Vikram NPosted Dec 4, 2013, 6:09 AM
Thanks a lot for the reply!!
Actually I did that, But what if the class is modified like this?
public class Animal
{
public int x;
public int y;
Class1 c1;
}
public class Class1
{
Class2 c2;
}
public class Class2
{
public int z;
}
Thanx :)
shilpaka anjinappaPosted Dec 4, 2013, 4:16 AM