NUnit Test case

using System;
using System.Collections.Generic ;
using System.Linq;
using System. Text;
using System. Threading. Tasks;

namespace DemoAppCore{

public class Program
{
public static Enployee e1 = null;
public static Employee EnrollEmployee()
{
return new Employee(){Name="Tom", Id="A1234" };
}
}
public class Employee
{
public string Name { get; set; }
public string Id { get; set; }
}

Please anyone help me to write a C# NUnit Test case for this program.I tried many different way to solve this program but none of the test cases work. Class Program This class contains a method, 'EnrollEmployee' In this method, an object for "Employee" is created and returned.

Class Employee This is a model class containing Name and Id property.

Write respective test methods for the following : a) Variable "e1" is null b) On invoking method 'EnrollEmployee', the object returned is not null. c) The "Name" property is equal to "Tom" by invoking method 'EnrollEmployee' d) The "Id" property is equal to "A1234" by invoking method 'EnrollEmployee'

Implement:

  1. Add the required test attribute for the class FunctionalTest
  2. Add the required test attribute for each test methods
  3. Wherever applicable, Assert whether the actual is equal to the expected
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum