As far as I know, the unit test should be designed as each method will have its own test. Each method will be regarded as a unit. That means each method will have its own mock data.
If you want to test the GetUserAccountNo, and it will use CreateUser and GetUser method. Normally, in asp.net core these two method will be inside a service class and then we will inject that service class and call it.
If this is your codes, it will be normally mock as below:
[Fact]
public async Task UserAccountNo_YourClassName_WithUserNotFound()
{
// Arrange
var mockRepo = new Mock<IRepository>();
mockRepo.Setup(repo => repo.GetUserNotFound())
.ReturnsAsync(GetUser());
var mockRepo = new Mock<IRepository>();
mockRepo.Setup(repo => repo.CreateUser())
.ReturnsAsync(CreateUser());
var YourClassName= new YourClassName(mockRepo.Object);
// Act
var result = await YourClassName.UserAccountNo();
// Assert
.....
}
public User GetUserNotFound(string id)
{
//Build a mock data and return it
return new User();
}
public User CreateUser(string id)
{
//Build a mock data and return it
return new User();
}