Documentation ¶
Overview ¶
Package strings provides members to register and test string Mock objects. It is intended to be used in concert with "*testing.T" functions, and the "go test" command, which automates execution of any function of the form:
"func TestXxx(*testing.T)" functions.
Index ¶
- func Fluent(t *testing.T) fluent.IFluent[string, IComparable]
- type Additional
- type Comparable
- func (s *Comparable) Be(value string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) BeEmpty()
- func (s *Comparable) BeOneOf(values []string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) BeWhiteSpace()
- func (s *Comparable) EndWith(suffix string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) HaveFnv32aSumOf(sumValue uint32) fluent.IAdditional[string, IComparable]
- func (s *Comparable) HaveFnv64aSumOf(sumValue uint64) fluent.IAdditional[string, IComparable]
- func (s *Comparable) HaveLengthOf(length int) fluent.IAdditional[string, IComparable]
- func (s *Comparable) Match(pattern string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) NotBe(value string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) NotBeEmpty() fluent.IAdditional[string, IComparable]
- func (s *Comparable) NotBeOneOf(values []string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) NotEndWith(suffix string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) NotMatch(pattern string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) NotStartWith(prefix string) fluent.IAdditional[string, IComparable]
- func (s *Comparable) StartWith(prefix string) fluent.IAdditional[string, IComparable]
- type FluentT
- type IComparable
- type String
- type Subject
- type Testable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Additional ¶
type Additional struct {
*Comparable
}
Additional is a type returned by some easy-to-use testing methods, providing basic additive test chaining with "And()".
func (*Additional) And ¶
func (s *Additional) And() IComparable
And extends the testing operation againts the Mock subject, returning an "*Comparable" object which provides a set of easy-to-use methods to test the subject in an additive maner.
The "And()" method works as an additive connector between test methods from "IComparable", allowing execution of chained testing methods.
type Comparable ¶
type Comparable struct {
*Testable
}
Comparable is a type returned by calling "fluentObj.It("My text string.").Should()", encapsulating a "*Testable[T]" object for further testing, and providing all the strings package's easy-to-use set of methods with signatures declared at the "strings.IComparable" interface.
NOTE: The "It()" method in the example accepts string objects.
func (*Comparable) Be ¶
func (s *Comparable) Be(value string) fluent.IAdditional[string, IComparable]
func (*Comparable) BeEmpty ¶
func (s *Comparable) BeEmpty()
func (*Comparable) BeOneOf ¶
func (s *Comparable) BeOneOf(values []string) fluent.IAdditional[string, IComparable]
func (*Comparable) BeWhiteSpace ¶
func (s *Comparable) BeWhiteSpace()
func (*Comparable) EndWith ¶
func (s *Comparable) EndWith(suffix string) fluent.IAdditional[string, IComparable]
func (*Comparable) HaveFnv32aSumOf ¶
func (s *Comparable) HaveFnv32aSumOf(sumValue uint32) fluent.IAdditional[string, IComparable]
func (*Comparable) HaveFnv64aSumOf ¶
func (s *Comparable) HaveFnv64aSumOf(sumValue uint64) fluent.IAdditional[string, IComparable]
func (*Comparable) HaveLengthOf ¶
func (s *Comparable) HaveLengthOf(length int) fluent.IAdditional[string, IComparable]
func (*Comparable) Match ¶
func (s *Comparable) Match(pattern string) fluent.IAdditional[string, IComparable]
func (*Comparable) NotBe ¶
func (s *Comparable) NotBe(value string) fluent.IAdditional[string, IComparable]
func (*Comparable) NotBeEmpty ¶
func (s *Comparable) NotBeEmpty() fluent.IAdditional[string, IComparable]
func (*Comparable) NotBeOneOf ¶
func (s *Comparable) NotBeOneOf(values []string) fluent.IAdditional[string, IComparable]
func (*Comparable) NotEndWith ¶
func (s *Comparable) NotEndWith(suffix string) fluent.IAdditional[string, IComparable]
func (*Comparable) NotMatch ¶
func (s *Comparable) NotMatch(pattern string) fluent.IAdditional[string, IComparable]
func (*Comparable) NotStartWith ¶
func (s *Comparable) NotStartWith(prefix string) fluent.IAdditional[string, IComparable]
func (*Comparable) StartWith ¶
func (s *Comparable) StartWith(prefix string) fluent.IAdditional[string, IComparable]
type FluentT ¶
type FluentT struct {
// contains filtered or unexported fields
}
FluentT is a type returned by calling "strings.Fluent(t)" for enabling easy-to-use testing methods.
It carries the "*testing.T" object to be further used in the methods chain.
type IComparable ¶
type IComparable interface { fluent.IComparable[string] Be(value string) fluent.IAdditional[string, IComparable] BeEmpty() BeOneOf(values []string) fluent.IAdditional[string, IComparable] NotBe(value string) fluent.IAdditional[string, IComparable] NotBeEmpty() fluent.IAdditional[string, IComparable] NotBeOneOf(values []string) fluent.IAdditional[string, IComparable] Match(pattern string) fluent.IAdditional[string, IComparable] NotMatch(pattern string) fluent.IAdditional[string, IComparable] StartWith(prefix string) fluent.IAdditional[string, IComparable] NotStartWith(prefix string) fluent.IAdditional[string, IComparable] EndWith(suffix string) fluent.IAdditional[string, IComparable] NotEndWith(suffix string) fluent.IAdditional[string, IComparable] HaveLengthOf(length int) fluent.IAdditional[string, IComparable] HaveFnv32aSumOf(sumValue uint32) fluent.IAdditional[string, IComparable] HaveFnv64aSumOf(sumValue uint64) fluent.IAdditional[string, IComparable] }
IComparable interface for the strings package. Following the Fluent-Interface design pattern to provide chained testing methods.
type Subject ¶
type Subject struct {
*Testable
}
Subject is a type returned by calling "fluentObj.It("My text string.")" used to encapsulate the "*testing.T" object and testable subject.
NOTE: The "It()" method in the example accepts string objects.
func (*Subject) Should ¶
func (s *Subject) Should() IComparable
Should starts the testing operations agains the Mock subject, returning an "*Comparable" object which provides a set of easy-to-use methods to test the subject in an additive maner.