tests

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tests contains tests for minimock tool and demonstrates minimock features

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	// contains filtered or unexported methods
}

Formatter interface is used to test code generated by minimock

type FormatterMock

type FormatterMock struct {
	FormatFunc       func(p string, p1 ...interface{}) (r string)
	FormatCounter    uint64
	FormatPreCounter uint64
	FormatMock       mFormatterMockFormat
	// contains filtered or unexported fields
}

FormatterMock implements github.com/gojuno/minimock/tests.Formatter

func NewFormatterMock

func NewFormatterMock(t minimock.Tester) *FormatterMock

NewFormatterMock returns a mock for github.com/gojuno/minimock/tests.Formatter

func (*FormatterMock) AllMocksCalled

func (m *FormatterMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*FormatterMock) CheckMocksCalled

func (m *FormatterMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*FormatterMock) Finish

func (m *FormatterMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*FormatterMock) Format

func (m *FormatterMock) Format(p string, p1 ...interface{}) (r string)

Format implements github.com/gojuno/minimock/tests.Formatter interface

func (*FormatterMock) FormatFinished

func (m *FormatterMock) FormatFinished() bool

FormatFinished returns true if mock invocations count is ok

func (*FormatterMock) FormatMinimockCounter

func (m *FormatterMock) FormatMinimockCounter() uint64

FormatMinimockCounter returns a count of FormatterMock.FormatFunc invocations

func (*FormatterMock) FormatMinimockPreCounter

func (m *FormatterMock) FormatMinimockPreCounter() uint64

FormatMinimockPreCounter returns the value of FormatterMock.Format invocations

func (*FormatterMock) MinimockFinish

func (m *FormatterMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*FormatterMock) MinimockWait

func (m *FormatterMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*FormatterMock) ValidateCallCounters

func (m *FormatterMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*FormatterMock) Wait

func (m *FormatterMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type FormatterMockFormatExpectation

type FormatterMockFormatExpectation struct {
	// contains filtered or unexported fields
}

FormatterMockFormatExpectation specifies expectation struct of the Formatter.Format

func (*FormatterMockFormatExpectation) Return

Return sets up return arguments of expectation struct for Formatter.Format

type FormatterMockFormatInput

type FormatterMockFormatInput struct {
	// contains filtered or unexported fields
}

FormatterMockFormatInput represents input parameters of the Formatter.Format

type FormatterMockFormatResult

type FormatterMockFormatResult struct {
	// contains filtered or unexported fields
}

FormatterMockFormatResult represents results of the Formatter.Format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL