-1
I’m trying to create a unit test to ensure that an attribute of an X class is actually changed. But to compare it at the end of my test, something like:
Assert.Equal(_sampleClass.Email, mockEmail);
I need it to have a value different from what is set in the constructor, since if it does, it can never perform what is below the condition:
public class SampleClass(){
private string Id {get; private set};
private string Name {get; private set}
private StatusClass Status {get; private set}
public SampleClass(string id, string name)
{
this.Id = id,
this.Name = name,
this.Status = StatusClass.Accepted
}
public void ChangeStatus(email){
if(this.Status == StatusClass.Accepted)
// get out of the method
this.Email = email;
}
}
I am looking for a way through unit tests to exchange the attribute Class status...
I have, I will review the logic and understand some way to test the method in question. Thank you.
– accelerate