public void Run() { var table = Substitute.For<ITableStorage>(); table.CreateIfNotExists(); var task = new InitializeStorageTask(table); task.Run(); table.Received().CreateIfNotExists(); }