public async Task Create_should_create_domain_object() { var command = new CreateAsset { AssetId = assetId, File = file }; var context = CreateContextForCommand(command); A.CallTo(() => tagGenerator.GenerateTags(command, A <HashSet <string> > .Ignored)) .Invokes(new Action <CreateAsset, HashSet <string> >((c, tags) => { tags.Add("tag1"); tags.Add("tag2"); })); SetupStore(0, context.ContextId); SetupImageInfo(); await sut.HandleAsync(context); var result = context.Result <AssetCreatedResult>(); Assert.Equal(assetId, result.Id); Assert.Contains("tag1", result.Tags); Assert.Contains("tag2", result.Tags); AssertAssetHasBeenUploaded(0, context.ContextId); AssertAssetImageChecked(); }
private void SetupTags(CreateAsset command) { A.CallTo(() => tagGenerator.GenerateTags(command, A <HashSet <string> > .Ignored)) .Invokes(new Action <CreateAsset, HashSet <string> >((c, tags) => { tags.Add("tag1"); tags.Add("tag2"); })); }