Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldInfo ¶
type FieldInfo struct { // インタフェースか否か IsInterface bool // パッケージ名 PackageName string // 型名 TypeName string // テンプレートのパラメータに用いる型名 UpperCamelCaseTypeName string }
FieldInfo フィールド情報
type IFDepMethod ¶
type MockMethod ¶
type MockMethod struct { // メソッドを持つフィールド Field string // メソッド名 Name string // ASTにおける出現位置 Position token.Pos // 引数の数 ArgLen int // 戻り値の数 ReturnLen int }
MockMethod モック化するメソッド
func (*MockMethod) GetPosition ¶
func (m *MockMethod) GetPosition() token.Pos
type TargetMethod ¶
TargetMethod テスト対象のメソッド
func (*TargetMethod) GetPosition ¶
func (m *TargetMethod) GetPosition() token.Pos
type TemplateMockMethod ¶
type TemplateMockMethod struct { // メソッド名 Name string // ASTにおけるメソッドの位置 Position int // 引数(nil*引数の数) Arg string // 戻り値(nil*戻り値の数) Return string }
TemplateMockMethod テンプレートのパラメータ用のmock化するメソッド
type TemplateParams ¶
type TemplateParams struct { // テスト対象メソッドを持つ構造体のフィールドの情報 FieldMap map[string]*FieldInfo // テスト対象メソッドごとのテストケースの情報 TargetMethodTesCasesMap map[string][]*UpdateTestCase }
TemplateParams jsonに渡すパラメータ
func CreateTemplateParams ¶
func CreateTemplateParams(t *TestFile) *TemplateParams
CreateTemplateParams テスト対象のファイルから抽出した情報(*TestFile)を元にテンプレートのパラメータを返す
func (*TemplateParams) ToJson ¶
func (t *TemplateParams) ToJson() ([]byte, error)
type TestCase ¶
type TestCase struct { // テストケースの分岐点となるif文の行数 Line int // 正常系か IsSuccessPattern bool // contains filtered or unexported fields }
TestCase テストケース
type TestFile ¶
type TestFile struct { // テスト対象のメソッドを持つ構造体のフィールド情報を管理 FieldMap map[string]*FieldInfo // 各テスト対象のメソッドのテストケース一覧を管理 TargetMethodTesCasesMap map[string][]*TestCase }
TestFile テスト対象ファイルのASTから抽出した値を格納する構造体
type UpdateTestCase ¶
type UpdateTestCase struct { // テストケースの分岐点となる行数 Line int // 正常系のテストケースか否か IsSuccessPattern bool // テストケース内で利用されている各フィールドのメソッド群 DepMethodsInField map[string][]*TemplateMockMethod }
UpdateTestCase テンプレートのパラメータ用に更新されたテストケース
Click to show internal directories.
Click to hide internal directories.