This message was deleted.
# dotnet
s
This message was deleted.
t
Thank you for reporting this! The example should be something like
Copy code
public static class Testing
{
    public static Task<ImmutableArray<Resource>> RunAsync<T>() where T : Stack, new()
    {
        var mocks = new Mock<IMocks>();
        mocks.Setup(m => m.NewResourceAsync(It.IsAny<MockResourceArgs>()))
            .ReturnsAsync((MockResourceArgs args) => (args.Id, args.Inputs));
        mocks.Setup(m => m.CallAsync(It.IsAny<MockCallArgs>()))
            .ReturnsAsync((MockCallArgs args) => args.Args);
        return Deployment.TestAsync<T>(mocks.Object, new TestOptions { IsPreview = false });
    }
}
If this works for you, I will open a PR for docs
m
So it sort of works, it does return the resource properties, but the resource name is null
Thats the actual Azure resource name property, not the Pulumi resource name
t
I guess you’d need to set it manually in the callback. Was it working in 2.0?
m
Yeah it was
t
Which resources are you testing? Azure Native? Was it also Azure Native in 2.0?