タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

testとgolangに関するsimarのブックマーク (4)

  • Golden Files — Why you should use them

    A Golden file from the fabric8 project — https://github.com/fabric8-services/fabric8-wit/blob/master/controller/test-files/label/update/ok.label.golden.jsonTesting responses from an API is often straightforward and monotonous. You set a few headers, make a request and assert the received response. The problem starts when your API sends a huge amount of data in the response. You validate each attri

    Golden Files — Why you should use them
  • Testing with golden files in Go

    When writing unit tests, there comes a point when you need to check that the complex output of a function matches your expectations. This could be binary data (like an Image), JSON, HTML etc. Golden files are a way of ensuring your function output matches its .golden file. It’s a pattern used in the Go standard library, which we’re going to take a look at now. We’ll start by writing a fairly contr

    Testing with golden files in Go
  • Go 言語 testing チートシート - Qiita

    はじめに このページでは testing パッケージの詳しい Example をチートシートとしてまとめました。 ご案内 このページの内容を別サイトにまとめなおしました。 目的別に項目を分けたのでやりたいことからコードを逆引きできます。 また、サイト上でコードを即時実行できるように The Go Playground の実行フォームを埋め込んだので、気軽にコードをお試しいただけます。 目次 関数のテストを書く テストを実行する メソッドのテストをする テスト失敗時にテストを継続する・テストを即時終了する 複数のテストデータでテストする テストを階層化する テストの開始終了処理を行う パッケージ単位でテストの開始終了処理を行う 別ファイルのテストデータを読み込む 入出力を持つ関数のテストをする HTTP ハンドラーをテストする HTTP サーバーをテストする テストファイルを作成する テスト

    Go 言語 testing チートシート - Qiita
  • Golangにおけるinterfaceをつかったテストで mock を書く技法 - haya14busa

    いい記事に感化されて僕も何か書きたくなった。 Golangにおけるinterfaceをつかったテスト技法 | SOTA リスペクト: Big Sky :: golang で終了を確認するテストの書き方 GolangAPI Clientを実装する | SOTA Big Sky :: GolangAPI Clientを実装する、の続き 今週のやつではなく先週のです.今週のは特に知見がなかった…grpc-goとか使えたらクライアント勝手に生成されるしいいよねgrpc流行ると便利そう(感想) くらい Golangにおけるinterfaceをつかったテスト技法 | SOTA めっちゃいいなーと思ったんですが,テスト用 の mock を気軽に作るテクニックはあまり詳しく紹介されてなかったのでそのあたりの1つのテクニックを書きたい. 前提 僕もテストフレームワークや外部ツールは全く使わない.標準のt

  • 1