You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
633 B

using Model;
namespace UTests2;
public class MockNounoursStore : INounoursStore
{
public Func<Nounours?, Nounours?> Add {get; set;} = null!;
public Func<Nounours?, bool> Remove {get; set;} = null!;
Task<Nounours?> INounoursStore.Add(Nounours nounours)
{
if (Add != null)
{
return Task.FromResult(Add(nounours));
}
return Task.FromResult<Nounours?>(null);
}
Task<bool> INounoursStore.Remove(Nounours nounours)
{
if(Remove != null)
{
return Task.FromResult(Remove(nounours));
}
return Task.FromResult(false);
}
}