Question: I'm trying to write a unit test in C#.NET in the class below im formatting a message and im printing this message as showed below.

I'm trying to write a unit test in C#.NET in the class below im formatting a message and im printing this message as showed below. im grouping the items in {} as shown. this class will get a message that has the {} attributes but in this class im inheriting from Comman class where im formatting the message the way I have showen below. Can you write a unit test that will test if I the message formatted in CopyDocumentHistory class will match the unit test format. kinda like Assert.AreEqual()?

namespace Historian.Commands {

public class CopyDocumentHistory : Command { //Command is an abstract class contains properties: ClientUserName, ClientAppId, SourceLoanNumber, DetinationLoanNumber

public override string FormattedText() { //method to format a message returning a string

return $"Copied by {ClientUserName} using application {ClientAppId} from loan {SourceLoanNumber} to loan {DestinationLoanNumber}"; //the formatted message

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!