浏览代码

Add mocks

Dima 2 年之前
父节点
当前提交
8da3aabbaa

二进制
build/app/app


+ 9 - 3
go.mod

@@ -3,22 +3,28 @@ module github.com/dmitriygnatenko
 go 1.18
 
 require (
+	github.com/brianvoe/gofakeit/v6 v6.19.0
+	github.com/go-playground/locales v0.14.0
+	github.com/go-playground/universal-translator v0.18.0
 	github.com/go-playground/validator/v10 v10.11.1
 	github.com/go-sql-driver/mysql v1.6.0
-	github.com/gofiber/fiber/v2 v2.37.1
+	github.com/gofiber/fiber/v2 v2.38.1
 	github.com/gofiber/template v1.7.1
+	github.com/gojuno/minimock/v3 v3.0.10
+	github.com/stretchr/testify v1.7.0
 )
 
 require (
 	github.com/andybalholm/brotli v1.0.4 // indirect
-	github.com/go-playground/locales v0.14.0 // indirect
-	github.com/go-playground/universal-translator v0.18.0 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/klauspost/compress v1.15.9 // indirect
 	github.com/leodido/go-urn v1.2.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/valyala/bytebufferpool v1.0.0 // indirect
 	github.com/valyala/fasthttp v1.40.0 // indirect
 	github.com/valyala/tcplisten v1.0.0 // indirect
 	golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
 	golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 // indirect
 	golang.org/x/text v0.3.7 // indirect
+	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
 )

+ 17 - 1
go.sum

@@ -71,6 +71,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
+github.com/brianvoe/gofakeit/v6 v6.19.0 h1:g+yJ+meWVEsAmR+bV4mNM/eXI0N+0pZ3D+Mi+G5+YQo=
+github.com/brianvoe/gofakeit/v6 v6.19.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8=
 github.com/cbroglie/mustache v1.4.0/go.mod h1:SS1FTIghy0sjse4DUVGV1k/40B1qE1XkD9DtDsHo9iM=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -137,12 +139,16 @@ github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfC
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
-github.com/gofiber/fiber/v2 v2.37.1 h1:QK2032gjv0ulegpv/qlTEBoXQD3eFFzCHXcNN12UZCs=
 github.com/gofiber/fiber/v2 v2.37.1/go.mod h1:j3UslgQeJQP3mNhBxHnLLE8TPqA1Fd/lrl4gD25rRUY=
+github.com/gofiber/fiber/v2 v2.38.1 h1:GEQ/Yt3Wsf2a30iTqtLXlBYJZso0JXPovt/tmj5H9jU=
+github.com/gofiber/fiber/v2 v2.38.1/go.mod h1:t0NlbaXzuGH7I+7M4paE848fNWInZ7mfxI/Er1fTth8=
 github.com/gofiber/template v1.7.1 h1:QCRChZA6UrLROgMbzCMKm4a1yqM/5S8RTBKYWZ9GfL4=
 github.com/gofiber/template v1.7.1/go.mod h1:l3ZOSp8yrMvROzqyh0QTCw7MHet/yLBzaRX+wsiw+gM=
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/gojuno/minimock/v3 v3.0.4/go.mod h1:HqeqnwV8mAABn3pO5hqF+RE7gjA0jsN8cbbSogoGrzI=
+github.com/gojuno/minimock/v3 v3.0.10 h1:0UbfgdLHaNRPHWF/RFYPkwxV2KI+SE4tR0dDSFMD7+A=
+github.com/gojuno/minimock/v3 v3.0.10/go.mod h1:CFXcUJYnBe+1QuNzm+WmdPYtvi/+7zQcPcyQGsbcIXg=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -245,6 +251,8 @@ github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOn
 github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
 github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
 github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
+github.com/hexdigest/gowrap v1.1.7/go.mod h1:Z+nBFUDLa01iaNM+/jzoOA1JJ7sm51rnYFauKFUB5fs=
+github.com/hexdigest/gowrap v1.1.8/go.mod h1:H/JiFmQMp//tedlV8qt2xBdGzmne6bpbaSuiHmygnMw=
 github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -267,9 +275,11 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
 github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
 github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
 github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
@@ -304,12 +314,14 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -330,6 +342,7 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
 github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
@@ -356,6 +369,7 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
+github.com/twitchtv/twirp v5.8.0+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A=
 github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
 github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
 github.com/valyala/fasthttp v1.40.0 h1:CRq/00MfruPGFLTQKY8b+8SfdK60TxNztjRMnH0t1Yc=
@@ -601,6 +615,7 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn
 golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@@ -798,6 +813,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=

+ 4 - 0
internal/repositories/article.go

@@ -1,5 +1,9 @@
 package repositories
 
+//go:generate mkdir -p mocks
+//go:generate rm -rf ./mocks/*_minimock.go
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.IArticleRepository -o ./mocks/ -s "_minimock.go"
+
 import (
 	"context"
 	"database/sql"

+ 4 - 0
internal/repositories/article_tag.go

@@ -1,5 +1,9 @@
 package repositories
 
+//go:generate mkdir -p mocks
+//go:generate rm -rf ./mocks/*_minimock.go
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.IArticleTagRepository -o ./mocks/ -s "_minimock.go"
+
 import (
 	"context"
 	"database/sql"

+ 1885 - 0
internal/repositories/mocks/i_article_repository_minimock.go

@@ -0,0 +1,1885 @@
+package mocks
+
+// Code generated by http://github.com/gojuno/minimock (dev). DO NOT EDIT.
+
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.IArticleRepository -o ./mocks/i_article_repository_minimock.go -n IArticleRepositoryMock
+
+import (
+	"context"
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/dmitriygnatenko/internal/models"
+	"github.com/gojuno/minimock/v3"
+)
+
+// IArticleRepositoryMock implements interfaces.IArticleRepository
+type IArticleRepositoryMock struct {
+	t minimock.Tester
+
+	funcAdd          func(ctx context.Context, m models.Article) (i1 int, err error)
+	inspectFuncAdd   func(ctx context.Context, m models.Article)
+	afterAddCounter  uint64
+	beforeAddCounter uint64
+	AddMock          mIArticleRepositoryMockAdd
+
+	funcDelete          func(ctx context.Context, ID int) (err error)
+	inspectFuncDelete   func(ctx context.Context, ID int)
+	afterDeleteCounter  uint64
+	beforeDeleteCounter uint64
+	DeleteMock          mIArticleRepositoryMockDelete
+
+	funcGetAll          func(ctx context.Context) (aa1 []models.Article, err error)
+	inspectFuncGetAll   func(ctx context.Context)
+	afterGetAllCounter  uint64
+	beforeGetAllCounter uint64
+	GetAllMock          mIArticleRepositoryMockGetAll
+
+	funcGetAllPreview          func(ctx context.Context) (aa1 []models.ArticlePreview, err error)
+	inspectFuncGetAllPreview   func(ctx context.Context)
+	afterGetAllPreviewCounter  uint64
+	beforeGetAllPreviewCounter uint64
+	GetAllPreviewMock          mIArticleRepositoryMockGetAllPreview
+
+	funcGetByID          func(ctx context.Context, ID int) (ap1 *models.Article, err error)
+	inspectFuncGetByID   func(ctx context.Context, ID int)
+	afterGetByIDCounter  uint64
+	beforeGetByIDCounter uint64
+	GetByIDMock          mIArticleRepositoryMockGetByID
+
+	funcGetByURL          func(ctx context.Context, url string) (ap1 *models.Article, err error)
+	inspectFuncGetByURL   func(ctx context.Context, url string)
+	afterGetByURLCounter  uint64
+	beforeGetByURLCounter uint64
+	GetByURLMock          mIArticleRepositoryMockGetByURL
+
+	funcGetPreviewByTagID          func(ctx context.Context, tagID int) (aa1 []models.ArticlePreview, err error)
+	inspectFuncGetPreviewByTagID   func(ctx context.Context, tagID int)
+	afterGetPreviewByTagIDCounter  uint64
+	beforeGetPreviewByTagIDCounter uint64
+	GetPreviewByTagIDMock          mIArticleRepositoryMockGetPreviewByTagID
+
+	funcUpdate          func(ctx context.Context, m models.Article) (err error)
+	inspectFuncUpdate   func(ctx context.Context, m models.Article)
+	afterUpdateCounter  uint64
+	beforeUpdateCounter uint64
+	UpdateMock          mIArticleRepositoryMockUpdate
+}
+
+// NewIArticleRepositoryMock returns a mock for interfaces.IArticleRepository
+func NewIArticleRepositoryMock(t minimock.Tester) *IArticleRepositoryMock {
+	m := &IArticleRepositoryMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.AddMock = mIArticleRepositoryMockAdd{mock: m}
+	m.AddMock.callArgs = []*IArticleRepositoryMockAddParams{}
+
+	m.DeleteMock = mIArticleRepositoryMockDelete{mock: m}
+	m.DeleteMock.callArgs = []*IArticleRepositoryMockDeleteParams{}
+
+	m.GetAllMock = mIArticleRepositoryMockGetAll{mock: m}
+	m.GetAllMock.callArgs = []*IArticleRepositoryMockGetAllParams{}
+
+	m.GetAllPreviewMock = mIArticleRepositoryMockGetAllPreview{mock: m}
+	m.GetAllPreviewMock.callArgs = []*IArticleRepositoryMockGetAllPreviewParams{}
+
+	m.GetByIDMock = mIArticleRepositoryMockGetByID{mock: m}
+	m.GetByIDMock.callArgs = []*IArticleRepositoryMockGetByIDParams{}
+
+	m.GetByURLMock = mIArticleRepositoryMockGetByURL{mock: m}
+	m.GetByURLMock.callArgs = []*IArticleRepositoryMockGetByURLParams{}
+
+	m.GetPreviewByTagIDMock = mIArticleRepositoryMockGetPreviewByTagID{mock: m}
+	m.GetPreviewByTagIDMock.callArgs = []*IArticleRepositoryMockGetPreviewByTagIDParams{}
+
+	m.UpdateMock = mIArticleRepositoryMockUpdate{mock: m}
+	m.UpdateMock.callArgs = []*IArticleRepositoryMockUpdateParams{}
+
+	return m
+}
+
+type mIArticleRepositoryMockAdd struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockAddExpectation
+	expectations       []*IArticleRepositoryMockAddExpectation
+
+	callArgs []*IArticleRepositoryMockAddParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockAddExpectation specifies expectation struct of the IArticleRepository.Add
+type IArticleRepositoryMockAddExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockAddParams
+	results *IArticleRepositoryMockAddResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockAddParams contains parameters of the IArticleRepository.Add
+type IArticleRepositoryMockAddParams struct {
+	ctx context.Context
+	m   models.Article
+}
+
+// IArticleRepositoryMockAddResults contains results of the IArticleRepository.Add
+type IArticleRepositoryMockAddResults struct {
+	i1  int
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.Add
+func (mmAdd *mIArticleRepositoryMockAdd) Expect(ctx context.Context, m models.Article) *mIArticleRepositoryMockAdd {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("IArticleRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &IArticleRepositoryMockAddExpectation{}
+	}
+
+	mmAdd.defaultExpectation.params = &IArticleRepositoryMockAddParams{ctx, m}
+	for _, e := range mmAdd.expectations {
+		if minimock.Equal(e.params, mmAdd.defaultExpectation.params) {
+			mmAdd.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmAdd.defaultExpectation.params)
+		}
+	}
+
+	return mmAdd
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.Add
+func (mmAdd *mIArticleRepositoryMockAdd) Inspect(f func(ctx context.Context, m models.Article)) *mIArticleRepositoryMockAdd {
+	if mmAdd.mock.inspectFuncAdd != nil {
+		mmAdd.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.Add")
+	}
+
+	mmAdd.mock.inspectFuncAdd = f
+
+	return mmAdd
+}
+
+// Return sets up results that will be returned by IArticleRepository.Add
+func (mmAdd *mIArticleRepositoryMockAdd) Return(i1 int, err error) *IArticleRepositoryMock {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("IArticleRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &IArticleRepositoryMockAddExpectation{mock: mmAdd.mock}
+	}
+	mmAdd.defaultExpectation.results = &IArticleRepositoryMockAddResults{i1, err}
+	return mmAdd.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.Add method
+func (mmAdd *mIArticleRepositoryMockAdd) Set(f func(ctx context.Context, m models.Article) (i1 int, err error)) *IArticleRepositoryMock {
+	if mmAdd.defaultExpectation != nil {
+		mmAdd.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.Add method")
+	}
+
+	if len(mmAdd.expectations) > 0 {
+		mmAdd.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.Add method")
+	}
+
+	mmAdd.mock.funcAdd = f
+	return mmAdd.mock
+}
+
+// When sets expectation for the IArticleRepository.Add which will trigger the result defined by the following
+// Then helper
+func (mmAdd *mIArticleRepositoryMockAdd) When(ctx context.Context, m models.Article) *IArticleRepositoryMockAddExpectation {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("IArticleRepositoryMock.Add mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockAddExpectation{
+		mock:   mmAdd.mock,
+		params: &IArticleRepositoryMockAddParams{ctx, m},
+	}
+	mmAdd.expectations = append(mmAdd.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.Add return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockAddExpectation) Then(i1 int, err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockAddResults{i1, err}
+	return e.mock
+}
+
+// Add implements interfaces.IArticleRepository
+func (mmAdd *IArticleRepositoryMock) Add(ctx context.Context, m models.Article) (i1 int, err error) {
+	mm_atomic.AddUint64(&mmAdd.beforeAddCounter, 1)
+	defer mm_atomic.AddUint64(&mmAdd.afterAddCounter, 1)
+
+	if mmAdd.inspectFuncAdd != nil {
+		mmAdd.inspectFuncAdd(ctx, m)
+	}
+
+	mm_params := &IArticleRepositoryMockAddParams{ctx, m}
+
+	// Record call args
+	mmAdd.AddMock.mutex.Lock()
+	mmAdd.AddMock.callArgs = append(mmAdd.AddMock.callArgs, mm_params)
+	mmAdd.AddMock.mutex.Unlock()
+
+	for _, e := range mmAdd.AddMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.i1, e.results.err
+		}
+	}
+
+	if mmAdd.AddMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmAdd.AddMock.defaultExpectation.Counter, 1)
+		mm_want := mmAdd.AddMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockAddParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmAdd.t.Errorf("IArticleRepositoryMock.Add got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmAdd.AddMock.defaultExpectation.results
+		if mm_results == nil {
+			mmAdd.t.Fatal("No results are set for the IArticleRepositoryMock.Add")
+		}
+		return (*mm_results).i1, (*mm_results).err
+	}
+	if mmAdd.funcAdd != nil {
+		return mmAdd.funcAdd(ctx, m)
+	}
+	mmAdd.t.Fatalf("Unexpected call to IArticleRepositoryMock.Add. %v %v", ctx, m)
+	return
+}
+
+// AddAfterCounter returns a count of finished IArticleRepositoryMock.Add invocations
+func (mmAdd *IArticleRepositoryMock) AddAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.afterAddCounter)
+}
+
+// AddBeforeCounter returns a count of IArticleRepositoryMock.Add invocations
+func (mmAdd *IArticleRepositoryMock) AddBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.beforeAddCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.Add.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmAdd *mIArticleRepositoryMockAdd) Calls() []*IArticleRepositoryMockAddParams {
+	mmAdd.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockAddParams, len(mmAdd.callArgs))
+	copy(argCopy, mmAdd.callArgs)
+
+	mmAdd.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockAddDone returns true if the count of the Add invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockAddDone() bool {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.AddMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcAdd != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockAddInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockAddInspect() {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.Add with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.AddMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		if m.AddMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.Add")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.Add with params: %#v", *m.AddMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcAdd != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.Add")
+	}
+}
+
+type mIArticleRepositoryMockDelete struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockDeleteExpectation
+	expectations       []*IArticleRepositoryMockDeleteExpectation
+
+	callArgs []*IArticleRepositoryMockDeleteParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockDeleteExpectation specifies expectation struct of the IArticleRepository.Delete
+type IArticleRepositoryMockDeleteExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockDeleteParams
+	results *IArticleRepositoryMockDeleteResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockDeleteParams contains parameters of the IArticleRepository.Delete
+type IArticleRepositoryMockDeleteParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// IArticleRepositoryMockDeleteResults contains results of the IArticleRepository.Delete
+type IArticleRepositoryMockDeleteResults struct {
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.Delete
+func (mmDelete *mIArticleRepositoryMockDelete) Expect(ctx context.Context, ID int) *mIArticleRepositoryMockDelete {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("IArticleRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &IArticleRepositoryMockDeleteExpectation{}
+	}
+
+	mmDelete.defaultExpectation.params = &IArticleRepositoryMockDeleteParams{ctx, ID}
+	for _, e := range mmDelete.expectations {
+		if minimock.Equal(e.params, mmDelete.defaultExpectation.params) {
+			mmDelete.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDelete.defaultExpectation.params)
+		}
+	}
+
+	return mmDelete
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.Delete
+func (mmDelete *mIArticleRepositoryMockDelete) Inspect(f func(ctx context.Context, ID int)) *mIArticleRepositoryMockDelete {
+	if mmDelete.mock.inspectFuncDelete != nil {
+		mmDelete.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.Delete")
+	}
+
+	mmDelete.mock.inspectFuncDelete = f
+
+	return mmDelete
+}
+
+// Return sets up results that will be returned by IArticleRepository.Delete
+func (mmDelete *mIArticleRepositoryMockDelete) Return(err error) *IArticleRepositoryMock {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("IArticleRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &IArticleRepositoryMockDeleteExpectation{mock: mmDelete.mock}
+	}
+	mmDelete.defaultExpectation.results = &IArticleRepositoryMockDeleteResults{err}
+	return mmDelete.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.Delete method
+func (mmDelete *mIArticleRepositoryMockDelete) Set(f func(ctx context.Context, ID int) (err error)) *IArticleRepositoryMock {
+	if mmDelete.defaultExpectation != nil {
+		mmDelete.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.Delete method")
+	}
+
+	if len(mmDelete.expectations) > 0 {
+		mmDelete.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.Delete method")
+	}
+
+	mmDelete.mock.funcDelete = f
+	return mmDelete.mock
+}
+
+// When sets expectation for the IArticleRepository.Delete which will trigger the result defined by the following
+// Then helper
+func (mmDelete *mIArticleRepositoryMockDelete) When(ctx context.Context, ID int) *IArticleRepositoryMockDeleteExpectation {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("IArticleRepositoryMock.Delete mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockDeleteExpectation{
+		mock:   mmDelete.mock,
+		params: &IArticleRepositoryMockDeleteParams{ctx, ID},
+	}
+	mmDelete.expectations = append(mmDelete.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.Delete return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockDeleteExpectation) Then(err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockDeleteResults{err}
+	return e.mock
+}
+
+// Delete implements interfaces.IArticleRepository
+func (mmDelete *IArticleRepositoryMock) Delete(ctx context.Context, ID int) (err error) {
+	mm_atomic.AddUint64(&mmDelete.beforeDeleteCounter, 1)
+	defer mm_atomic.AddUint64(&mmDelete.afterDeleteCounter, 1)
+
+	if mmDelete.inspectFuncDelete != nil {
+		mmDelete.inspectFuncDelete(ctx, ID)
+	}
+
+	mm_params := &IArticleRepositoryMockDeleteParams{ctx, ID}
+
+	// Record call args
+	mmDelete.DeleteMock.mutex.Lock()
+	mmDelete.DeleteMock.callArgs = append(mmDelete.DeleteMock.callArgs, mm_params)
+	mmDelete.DeleteMock.mutex.Unlock()
+
+	for _, e := range mmDelete.DeleteMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmDelete.DeleteMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmDelete.DeleteMock.defaultExpectation.Counter, 1)
+		mm_want := mmDelete.DeleteMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockDeleteParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDelete.t.Errorf("IArticleRepositoryMock.Delete got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmDelete.DeleteMock.defaultExpectation.results
+		if mm_results == nil {
+			mmDelete.t.Fatal("No results are set for the IArticleRepositoryMock.Delete")
+		}
+		return (*mm_results).err
+	}
+	if mmDelete.funcDelete != nil {
+		return mmDelete.funcDelete(ctx, ID)
+	}
+	mmDelete.t.Fatalf("Unexpected call to IArticleRepositoryMock.Delete. %v %v", ctx, ID)
+	return
+}
+
+// DeleteAfterCounter returns a count of finished IArticleRepositoryMock.Delete invocations
+func (mmDelete *IArticleRepositoryMock) DeleteAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.afterDeleteCounter)
+}
+
+// DeleteBeforeCounter returns a count of IArticleRepositoryMock.Delete invocations
+func (mmDelete *IArticleRepositoryMock) DeleteBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.beforeDeleteCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.Delete.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDelete *mIArticleRepositoryMockDelete) Calls() []*IArticleRepositoryMockDeleteParams {
+	mmDelete.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockDeleteParams, len(mmDelete.callArgs))
+	copy(argCopy, mmDelete.callArgs)
+
+	mmDelete.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockDeleteDone returns true if the count of the Delete invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockDeleteDone() bool {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDelete != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockDeleteInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockDeleteInspect() {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.Delete with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		if m.DeleteMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.Delete")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.Delete with params: %#v", *m.DeleteMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDelete != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.Delete")
+	}
+}
+
+type mIArticleRepositoryMockGetAll struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockGetAllExpectation
+	expectations       []*IArticleRepositoryMockGetAllExpectation
+
+	callArgs []*IArticleRepositoryMockGetAllParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockGetAllExpectation specifies expectation struct of the IArticleRepository.GetAll
+type IArticleRepositoryMockGetAllExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockGetAllParams
+	results *IArticleRepositoryMockGetAllResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockGetAllParams contains parameters of the IArticleRepository.GetAll
+type IArticleRepositoryMockGetAllParams struct {
+	ctx context.Context
+}
+
+// IArticleRepositoryMockGetAllResults contains results of the IArticleRepository.GetAll
+type IArticleRepositoryMockGetAllResults struct {
+	aa1 []models.Article
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.GetAll
+func (mmGetAll *mIArticleRepositoryMockGetAll) Expect(ctx context.Context) *mIArticleRepositoryMockGetAll {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("IArticleRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &IArticleRepositoryMockGetAllExpectation{}
+	}
+
+	mmGetAll.defaultExpectation.params = &IArticleRepositoryMockGetAllParams{ctx}
+	for _, e := range mmGetAll.expectations {
+		if minimock.Equal(e.params, mmGetAll.defaultExpectation.params) {
+			mmGetAll.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetAll.defaultExpectation.params)
+		}
+	}
+
+	return mmGetAll
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.GetAll
+func (mmGetAll *mIArticleRepositoryMockGetAll) Inspect(f func(ctx context.Context)) *mIArticleRepositoryMockGetAll {
+	if mmGetAll.mock.inspectFuncGetAll != nil {
+		mmGetAll.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.GetAll")
+	}
+
+	mmGetAll.mock.inspectFuncGetAll = f
+
+	return mmGetAll
+}
+
+// Return sets up results that will be returned by IArticleRepository.GetAll
+func (mmGetAll *mIArticleRepositoryMockGetAll) Return(aa1 []models.Article, err error) *IArticleRepositoryMock {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("IArticleRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &IArticleRepositoryMockGetAllExpectation{mock: mmGetAll.mock}
+	}
+	mmGetAll.defaultExpectation.results = &IArticleRepositoryMockGetAllResults{aa1, err}
+	return mmGetAll.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.GetAll method
+func (mmGetAll *mIArticleRepositoryMockGetAll) Set(f func(ctx context.Context) (aa1 []models.Article, err error)) *IArticleRepositoryMock {
+	if mmGetAll.defaultExpectation != nil {
+		mmGetAll.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.GetAll method")
+	}
+
+	if len(mmGetAll.expectations) > 0 {
+		mmGetAll.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.GetAll method")
+	}
+
+	mmGetAll.mock.funcGetAll = f
+	return mmGetAll.mock
+}
+
+// When sets expectation for the IArticleRepository.GetAll which will trigger the result defined by the following
+// Then helper
+func (mmGetAll *mIArticleRepositoryMockGetAll) When(ctx context.Context) *IArticleRepositoryMockGetAllExpectation {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("IArticleRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockGetAllExpectation{
+		mock:   mmGetAll.mock,
+		params: &IArticleRepositoryMockGetAllParams{ctx},
+	}
+	mmGetAll.expectations = append(mmGetAll.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.GetAll return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockGetAllExpectation) Then(aa1 []models.Article, err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockGetAllResults{aa1, err}
+	return e.mock
+}
+
+// GetAll implements interfaces.IArticleRepository
+func (mmGetAll *IArticleRepositoryMock) GetAll(ctx context.Context) (aa1 []models.Article, err error) {
+	mm_atomic.AddUint64(&mmGetAll.beforeGetAllCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetAll.afterGetAllCounter, 1)
+
+	if mmGetAll.inspectFuncGetAll != nil {
+		mmGetAll.inspectFuncGetAll(ctx)
+	}
+
+	mm_params := &IArticleRepositoryMockGetAllParams{ctx}
+
+	// Record call args
+	mmGetAll.GetAllMock.mutex.Lock()
+	mmGetAll.GetAllMock.callArgs = append(mmGetAll.GetAllMock.callArgs, mm_params)
+	mmGetAll.GetAllMock.mutex.Unlock()
+
+	for _, e := range mmGetAll.GetAllMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.aa1, e.results.err
+		}
+	}
+
+	if mmGetAll.GetAllMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetAll.GetAllMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetAll.GetAllMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockGetAllParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAll.t.Errorf("IArticleRepositoryMock.GetAll got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetAll.GetAllMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetAll.t.Fatal("No results are set for the IArticleRepositoryMock.GetAll")
+		}
+		return (*mm_results).aa1, (*mm_results).err
+	}
+	if mmGetAll.funcGetAll != nil {
+		return mmGetAll.funcGetAll(ctx)
+	}
+	mmGetAll.t.Fatalf("Unexpected call to IArticleRepositoryMock.GetAll. %v", ctx)
+	return
+}
+
+// GetAllAfterCounter returns a count of finished IArticleRepositoryMock.GetAll invocations
+func (mmGetAll *IArticleRepositoryMock) GetAllAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.afterGetAllCounter)
+}
+
+// GetAllBeforeCounter returns a count of IArticleRepositoryMock.GetAll invocations
+func (mmGetAll *IArticleRepositoryMock) GetAllBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.beforeGetAllCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.GetAll.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAll *mIArticleRepositoryMockGetAll) Calls() []*IArticleRepositoryMockGetAllParams {
+	mmGetAll.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockGetAllParams, len(mmGetAll.callArgs))
+	copy(argCopy, mmGetAll.callArgs)
+
+	mmGetAll.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetAllDone returns true if the count of the GetAll invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockGetAllDone() bool {
+	for _, e := range m.GetAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAll != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetAllInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockGetAllInspect() {
+	for _, e := range m.GetAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetAll with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		if m.GetAllMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.GetAll")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetAll with params: %#v", *m.GetAllMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAll != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.GetAll")
+	}
+}
+
+type mIArticleRepositoryMockGetAllPreview struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockGetAllPreviewExpectation
+	expectations       []*IArticleRepositoryMockGetAllPreviewExpectation
+
+	callArgs []*IArticleRepositoryMockGetAllPreviewParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockGetAllPreviewExpectation specifies expectation struct of the IArticleRepository.GetAllPreview
+type IArticleRepositoryMockGetAllPreviewExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockGetAllPreviewParams
+	results *IArticleRepositoryMockGetAllPreviewResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockGetAllPreviewParams contains parameters of the IArticleRepository.GetAllPreview
+type IArticleRepositoryMockGetAllPreviewParams struct {
+	ctx context.Context
+}
+
+// IArticleRepositoryMockGetAllPreviewResults contains results of the IArticleRepository.GetAllPreview
+type IArticleRepositoryMockGetAllPreviewResults struct {
+	aa1 []models.ArticlePreview
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.GetAllPreview
+func (mmGetAllPreview *mIArticleRepositoryMockGetAllPreview) Expect(ctx context.Context) *mIArticleRepositoryMockGetAllPreview {
+	if mmGetAllPreview.mock.funcGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("IArticleRepositoryMock.GetAllPreview mock is already set by Set")
+	}
+
+	if mmGetAllPreview.defaultExpectation == nil {
+		mmGetAllPreview.defaultExpectation = &IArticleRepositoryMockGetAllPreviewExpectation{}
+	}
+
+	mmGetAllPreview.defaultExpectation.params = &IArticleRepositoryMockGetAllPreviewParams{ctx}
+	for _, e := range mmGetAllPreview.expectations {
+		if minimock.Equal(e.params, mmGetAllPreview.defaultExpectation.params) {
+			mmGetAllPreview.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetAllPreview.defaultExpectation.params)
+		}
+	}
+
+	return mmGetAllPreview
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.GetAllPreview
+func (mmGetAllPreview *mIArticleRepositoryMockGetAllPreview) Inspect(f func(ctx context.Context)) *mIArticleRepositoryMockGetAllPreview {
+	if mmGetAllPreview.mock.inspectFuncGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.GetAllPreview")
+	}
+
+	mmGetAllPreview.mock.inspectFuncGetAllPreview = f
+
+	return mmGetAllPreview
+}
+
+// Return sets up results that will be returned by IArticleRepository.GetAllPreview
+func (mmGetAllPreview *mIArticleRepositoryMockGetAllPreview) Return(aa1 []models.ArticlePreview, err error) *IArticleRepositoryMock {
+	if mmGetAllPreview.mock.funcGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("IArticleRepositoryMock.GetAllPreview mock is already set by Set")
+	}
+
+	if mmGetAllPreview.defaultExpectation == nil {
+		mmGetAllPreview.defaultExpectation = &IArticleRepositoryMockGetAllPreviewExpectation{mock: mmGetAllPreview.mock}
+	}
+	mmGetAllPreview.defaultExpectation.results = &IArticleRepositoryMockGetAllPreviewResults{aa1, err}
+	return mmGetAllPreview.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.GetAllPreview method
+func (mmGetAllPreview *mIArticleRepositoryMockGetAllPreview) Set(f func(ctx context.Context) (aa1 []models.ArticlePreview, err error)) *IArticleRepositoryMock {
+	if mmGetAllPreview.defaultExpectation != nil {
+		mmGetAllPreview.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.GetAllPreview method")
+	}
+
+	if len(mmGetAllPreview.expectations) > 0 {
+		mmGetAllPreview.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.GetAllPreview method")
+	}
+
+	mmGetAllPreview.mock.funcGetAllPreview = f
+	return mmGetAllPreview.mock
+}
+
+// When sets expectation for the IArticleRepository.GetAllPreview which will trigger the result defined by the following
+// Then helper
+func (mmGetAllPreview *mIArticleRepositoryMockGetAllPreview) When(ctx context.Context) *IArticleRepositoryMockGetAllPreviewExpectation {
+	if mmGetAllPreview.mock.funcGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("IArticleRepositoryMock.GetAllPreview mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockGetAllPreviewExpectation{
+		mock:   mmGetAllPreview.mock,
+		params: &IArticleRepositoryMockGetAllPreviewParams{ctx},
+	}
+	mmGetAllPreview.expectations = append(mmGetAllPreview.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.GetAllPreview return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockGetAllPreviewExpectation) Then(aa1 []models.ArticlePreview, err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockGetAllPreviewResults{aa1, err}
+	return e.mock
+}
+
+// GetAllPreview implements interfaces.IArticleRepository
+func (mmGetAllPreview *IArticleRepositoryMock) GetAllPreview(ctx context.Context) (aa1 []models.ArticlePreview, err error) {
+	mm_atomic.AddUint64(&mmGetAllPreview.beforeGetAllPreviewCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetAllPreview.afterGetAllPreviewCounter, 1)
+
+	if mmGetAllPreview.inspectFuncGetAllPreview != nil {
+		mmGetAllPreview.inspectFuncGetAllPreview(ctx)
+	}
+
+	mm_params := &IArticleRepositoryMockGetAllPreviewParams{ctx}
+
+	// Record call args
+	mmGetAllPreview.GetAllPreviewMock.mutex.Lock()
+	mmGetAllPreview.GetAllPreviewMock.callArgs = append(mmGetAllPreview.GetAllPreviewMock.callArgs, mm_params)
+	mmGetAllPreview.GetAllPreviewMock.mutex.Unlock()
+
+	for _, e := range mmGetAllPreview.GetAllPreviewMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.aa1, e.results.err
+		}
+	}
+
+	if mmGetAllPreview.GetAllPreviewMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetAllPreview.GetAllPreviewMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetAllPreview.GetAllPreviewMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockGetAllPreviewParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAllPreview.t.Errorf("IArticleRepositoryMock.GetAllPreview got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetAllPreview.GetAllPreviewMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetAllPreview.t.Fatal("No results are set for the IArticleRepositoryMock.GetAllPreview")
+		}
+		return (*mm_results).aa1, (*mm_results).err
+	}
+	if mmGetAllPreview.funcGetAllPreview != nil {
+		return mmGetAllPreview.funcGetAllPreview(ctx)
+	}
+	mmGetAllPreview.t.Fatalf("Unexpected call to IArticleRepositoryMock.GetAllPreview. %v", ctx)
+	return
+}
+
+// GetAllPreviewAfterCounter returns a count of finished IArticleRepositoryMock.GetAllPreview invocations
+func (mmGetAllPreview *IArticleRepositoryMock) GetAllPreviewAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllPreview.afterGetAllPreviewCounter)
+}
+
+// GetAllPreviewBeforeCounter returns a count of IArticleRepositoryMock.GetAllPreview invocations
+func (mmGetAllPreview *IArticleRepositoryMock) GetAllPreviewBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllPreview.beforeGetAllPreviewCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.GetAllPreview.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAllPreview *mIArticleRepositoryMockGetAllPreview) Calls() []*IArticleRepositoryMockGetAllPreviewParams {
+	mmGetAllPreview.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockGetAllPreviewParams, len(mmGetAllPreview.callArgs))
+	copy(argCopy, mmGetAllPreview.callArgs)
+
+	mmGetAllPreview.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetAllPreviewDone returns true if the count of the GetAllPreview invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockGetAllPreviewDone() bool {
+	for _, e := range m.GetAllPreviewMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllPreviewMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllPreviewCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAllPreview != nil && mm_atomic.LoadUint64(&m.afterGetAllPreviewCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetAllPreviewInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockGetAllPreviewInspect() {
+	for _, e := range m.GetAllPreviewMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetAllPreview with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllPreviewMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllPreviewCounter) < 1 {
+		if m.GetAllPreviewMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.GetAllPreview")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetAllPreview with params: %#v", *m.GetAllPreviewMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAllPreview != nil && mm_atomic.LoadUint64(&m.afterGetAllPreviewCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.GetAllPreview")
+	}
+}
+
+type mIArticleRepositoryMockGetByID struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockGetByIDExpectation
+	expectations       []*IArticleRepositoryMockGetByIDExpectation
+
+	callArgs []*IArticleRepositoryMockGetByIDParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockGetByIDExpectation specifies expectation struct of the IArticleRepository.GetByID
+type IArticleRepositoryMockGetByIDExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockGetByIDParams
+	results *IArticleRepositoryMockGetByIDResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockGetByIDParams contains parameters of the IArticleRepository.GetByID
+type IArticleRepositoryMockGetByIDParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// IArticleRepositoryMockGetByIDResults contains results of the IArticleRepository.GetByID
+type IArticleRepositoryMockGetByIDResults struct {
+	ap1 *models.Article
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.GetByID
+func (mmGetByID *mIArticleRepositoryMockGetByID) Expect(ctx context.Context, ID int) *mIArticleRepositoryMockGetByID {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("IArticleRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &IArticleRepositoryMockGetByIDExpectation{}
+	}
+
+	mmGetByID.defaultExpectation.params = &IArticleRepositoryMockGetByIDParams{ctx, ID}
+	for _, e := range mmGetByID.expectations {
+		if minimock.Equal(e.params, mmGetByID.defaultExpectation.params) {
+			mmGetByID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetByID.defaultExpectation.params)
+		}
+	}
+
+	return mmGetByID
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.GetByID
+func (mmGetByID *mIArticleRepositoryMockGetByID) Inspect(f func(ctx context.Context, ID int)) *mIArticleRepositoryMockGetByID {
+	if mmGetByID.mock.inspectFuncGetByID != nil {
+		mmGetByID.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.GetByID")
+	}
+
+	mmGetByID.mock.inspectFuncGetByID = f
+
+	return mmGetByID
+}
+
+// Return sets up results that will be returned by IArticleRepository.GetByID
+func (mmGetByID *mIArticleRepositoryMockGetByID) Return(ap1 *models.Article, err error) *IArticleRepositoryMock {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("IArticleRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &IArticleRepositoryMockGetByIDExpectation{mock: mmGetByID.mock}
+	}
+	mmGetByID.defaultExpectation.results = &IArticleRepositoryMockGetByIDResults{ap1, err}
+	return mmGetByID.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.GetByID method
+func (mmGetByID *mIArticleRepositoryMockGetByID) Set(f func(ctx context.Context, ID int) (ap1 *models.Article, err error)) *IArticleRepositoryMock {
+	if mmGetByID.defaultExpectation != nil {
+		mmGetByID.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.GetByID method")
+	}
+
+	if len(mmGetByID.expectations) > 0 {
+		mmGetByID.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.GetByID method")
+	}
+
+	mmGetByID.mock.funcGetByID = f
+	return mmGetByID.mock
+}
+
+// When sets expectation for the IArticleRepository.GetByID which will trigger the result defined by the following
+// Then helper
+func (mmGetByID *mIArticleRepositoryMockGetByID) When(ctx context.Context, ID int) *IArticleRepositoryMockGetByIDExpectation {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("IArticleRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockGetByIDExpectation{
+		mock:   mmGetByID.mock,
+		params: &IArticleRepositoryMockGetByIDParams{ctx, ID},
+	}
+	mmGetByID.expectations = append(mmGetByID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.GetByID return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockGetByIDExpectation) Then(ap1 *models.Article, err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockGetByIDResults{ap1, err}
+	return e.mock
+}
+
+// GetByID implements interfaces.IArticleRepository
+func (mmGetByID *IArticleRepositoryMock) GetByID(ctx context.Context, ID int) (ap1 *models.Article, err error) {
+	mm_atomic.AddUint64(&mmGetByID.beforeGetByIDCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetByID.afterGetByIDCounter, 1)
+
+	if mmGetByID.inspectFuncGetByID != nil {
+		mmGetByID.inspectFuncGetByID(ctx, ID)
+	}
+
+	mm_params := &IArticleRepositoryMockGetByIDParams{ctx, ID}
+
+	// Record call args
+	mmGetByID.GetByIDMock.mutex.Lock()
+	mmGetByID.GetByIDMock.callArgs = append(mmGetByID.GetByIDMock.callArgs, mm_params)
+	mmGetByID.GetByIDMock.mutex.Unlock()
+
+	for _, e := range mmGetByID.GetByIDMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.ap1, e.results.err
+		}
+	}
+
+	if mmGetByID.GetByIDMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetByID.GetByIDMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetByID.GetByIDMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockGetByIDParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByID.t.Errorf("IArticleRepositoryMock.GetByID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetByID.GetByIDMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetByID.t.Fatal("No results are set for the IArticleRepositoryMock.GetByID")
+		}
+		return (*mm_results).ap1, (*mm_results).err
+	}
+	if mmGetByID.funcGetByID != nil {
+		return mmGetByID.funcGetByID(ctx, ID)
+	}
+	mmGetByID.t.Fatalf("Unexpected call to IArticleRepositoryMock.GetByID. %v %v", ctx, ID)
+	return
+}
+
+// GetByIDAfterCounter returns a count of finished IArticleRepositoryMock.GetByID invocations
+func (mmGetByID *IArticleRepositoryMock) GetByIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.afterGetByIDCounter)
+}
+
+// GetByIDBeforeCounter returns a count of IArticleRepositoryMock.GetByID invocations
+func (mmGetByID *IArticleRepositoryMock) GetByIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.beforeGetByIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.GetByID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByID *mIArticleRepositoryMockGetByID) Calls() []*IArticleRepositoryMockGetByIDParams {
+	mmGetByID.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockGetByIDParams, len(mmGetByID.callArgs))
+	copy(argCopy, mmGetByID.callArgs)
+
+	mmGetByID.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetByIDDone returns true if the count of the GetByID invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockGetByIDDone() bool {
+	for _, e := range m.GetByIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByID != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetByIDInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockGetByIDInspect() {
+	for _, e := range m.GetByIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetByID with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		if m.GetByIDMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.GetByID")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetByID with params: %#v", *m.GetByIDMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByID != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.GetByID")
+	}
+}
+
+type mIArticleRepositoryMockGetByURL struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockGetByURLExpectation
+	expectations       []*IArticleRepositoryMockGetByURLExpectation
+
+	callArgs []*IArticleRepositoryMockGetByURLParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockGetByURLExpectation specifies expectation struct of the IArticleRepository.GetByURL
+type IArticleRepositoryMockGetByURLExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockGetByURLParams
+	results *IArticleRepositoryMockGetByURLResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockGetByURLParams contains parameters of the IArticleRepository.GetByURL
+type IArticleRepositoryMockGetByURLParams struct {
+	ctx context.Context
+	url string
+}
+
+// IArticleRepositoryMockGetByURLResults contains results of the IArticleRepository.GetByURL
+type IArticleRepositoryMockGetByURLResults struct {
+	ap1 *models.Article
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.GetByURL
+func (mmGetByURL *mIArticleRepositoryMockGetByURL) Expect(ctx context.Context, url string) *mIArticleRepositoryMockGetByURL {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("IArticleRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &IArticleRepositoryMockGetByURLExpectation{}
+	}
+
+	mmGetByURL.defaultExpectation.params = &IArticleRepositoryMockGetByURLParams{ctx, url}
+	for _, e := range mmGetByURL.expectations {
+		if minimock.Equal(e.params, mmGetByURL.defaultExpectation.params) {
+			mmGetByURL.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetByURL.defaultExpectation.params)
+		}
+	}
+
+	return mmGetByURL
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.GetByURL
+func (mmGetByURL *mIArticleRepositoryMockGetByURL) Inspect(f func(ctx context.Context, url string)) *mIArticleRepositoryMockGetByURL {
+	if mmGetByURL.mock.inspectFuncGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.GetByURL")
+	}
+
+	mmGetByURL.mock.inspectFuncGetByURL = f
+
+	return mmGetByURL
+}
+
+// Return sets up results that will be returned by IArticleRepository.GetByURL
+func (mmGetByURL *mIArticleRepositoryMockGetByURL) Return(ap1 *models.Article, err error) *IArticleRepositoryMock {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("IArticleRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &IArticleRepositoryMockGetByURLExpectation{mock: mmGetByURL.mock}
+	}
+	mmGetByURL.defaultExpectation.results = &IArticleRepositoryMockGetByURLResults{ap1, err}
+	return mmGetByURL.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.GetByURL method
+func (mmGetByURL *mIArticleRepositoryMockGetByURL) Set(f func(ctx context.Context, url string) (ap1 *models.Article, err error)) *IArticleRepositoryMock {
+	if mmGetByURL.defaultExpectation != nil {
+		mmGetByURL.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.GetByURL method")
+	}
+
+	if len(mmGetByURL.expectations) > 0 {
+		mmGetByURL.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.GetByURL method")
+	}
+
+	mmGetByURL.mock.funcGetByURL = f
+	return mmGetByURL.mock
+}
+
+// When sets expectation for the IArticleRepository.GetByURL which will trigger the result defined by the following
+// Then helper
+func (mmGetByURL *mIArticleRepositoryMockGetByURL) When(ctx context.Context, url string) *IArticleRepositoryMockGetByURLExpectation {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("IArticleRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockGetByURLExpectation{
+		mock:   mmGetByURL.mock,
+		params: &IArticleRepositoryMockGetByURLParams{ctx, url},
+	}
+	mmGetByURL.expectations = append(mmGetByURL.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.GetByURL return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockGetByURLExpectation) Then(ap1 *models.Article, err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockGetByURLResults{ap1, err}
+	return e.mock
+}
+
+// GetByURL implements interfaces.IArticleRepository
+func (mmGetByURL *IArticleRepositoryMock) GetByURL(ctx context.Context, url string) (ap1 *models.Article, err error) {
+	mm_atomic.AddUint64(&mmGetByURL.beforeGetByURLCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetByURL.afterGetByURLCounter, 1)
+
+	if mmGetByURL.inspectFuncGetByURL != nil {
+		mmGetByURL.inspectFuncGetByURL(ctx, url)
+	}
+
+	mm_params := &IArticleRepositoryMockGetByURLParams{ctx, url}
+
+	// Record call args
+	mmGetByURL.GetByURLMock.mutex.Lock()
+	mmGetByURL.GetByURLMock.callArgs = append(mmGetByURL.GetByURLMock.callArgs, mm_params)
+	mmGetByURL.GetByURLMock.mutex.Unlock()
+
+	for _, e := range mmGetByURL.GetByURLMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.ap1, e.results.err
+		}
+	}
+
+	if mmGetByURL.GetByURLMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetByURL.GetByURLMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetByURL.GetByURLMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockGetByURLParams{ctx, url}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByURL.t.Errorf("IArticleRepositoryMock.GetByURL got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetByURL.GetByURLMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetByURL.t.Fatal("No results are set for the IArticleRepositoryMock.GetByURL")
+		}
+		return (*mm_results).ap1, (*mm_results).err
+	}
+	if mmGetByURL.funcGetByURL != nil {
+		return mmGetByURL.funcGetByURL(ctx, url)
+	}
+	mmGetByURL.t.Fatalf("Unexpected call to IArticleRepositoryMock.GetByURL. %v %v", ctx, url)
+	return
+}
+
+// GetByURLAfterCounter returns a count of finished IArticleRepositoryMock.GetByURL invocations
+func (mmGetByURL *IArticleRepositoryMock) GetByURLAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.afterGetByURLCounter)
+}
+
+// GetByURLBeforeCounter returns a count of IArticleRepositoryMock.GetByURL invocations
+func (mmGetByURL *IArticleRepositoryMock) GetByURLBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.beforeGetByURLCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.GetByURL.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByURL *mIArticleRepositoryMockGetByURL) Calls() []*IArticleRepositoryMockGetByURLParams {
+	mmGetByURL.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockGetByURLParams, len(mmGetByURL.callArgs))
+	copy(argCopy, mmGetByURL.callArgs)
+
+	mmGetByURL.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetByURLDone returns true if the count of the GetByURL invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockGetByURLDone() bool {
+	for _, e := range m.GetByURLMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByURLMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByURL != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetByURLInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockGetByURLInspect() {
+	for _, e := range m.GetByURLMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetByURL with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByURLMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		if m.GetByURLMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.GetByURL")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetByURL with params: %#v", *m.GetByURLMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByURL != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.GetByURL")
+	}
+}
+
+type mIArticleRepositoryMockGetPreviewByTagID struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockGetPreviewByTagIDExpectation
+	expectations       []*IArticleRepositoryMockGetPreviewByTagIDExpectation
+
+	callArgs []*IArticleRepositoryMockGetPreviewByTagIDParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockGetPreviewByTagIDExpectation specifies expectation struct of the IArticleRepository.GetPreviewByTagID
+type IArticleRepositoryMockGetPreviewByTagIDExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockGetPreviewByTagIDParams
+	results *IArticleRepositoryMockGetPreviewByTagIDResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockGetPreviewByTagIDParams contains parameters of the IArticleRepository.GetPreviewByTagID
+type IArticleRepositoryMockGetPreviewByTagIDParams struct {
+	ctx   context.Context
+	tagID int
+}
+
+// IArticleRepositoryMockGetPreviewByTagIDResults contains results of the IArticleRepository.GetPreviewByTagID
+type IArticleRepositoryMockGetPreviewByTagIDResults struct {
+	aa1 []models.ArticlePreview
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.GetPreviewByTagID
+func (mmGetPreviewByTagID *mIArticleRepositoryMockGetPreviewByTagID) Expect(ctx context.Context, tagID int) *mIArticleRepositoryMockGetPreviewByTagID {
+	if mmGetPreviewByTagID.mock.funcGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("IArticleRepositoryMock.GetPreviewByTagID mock is already set by Set")
+	}
+
+	if mmGetPreviewByTagID.defaultExpectation == nil {
+		mmGetPreviewByTagID.defaultExpectation = &IArticleRepositoryMockGetPreviewByTagIDExpectation{}
+	}
+
+	mmGetPreviewByTagID.defaultExpectation.params = &IArticleRepositoryMockGetPreviewByTagIDParams{ctx, tagID}
+	for _, e := range mmGetPreviewByTagID.expectations {
+		if minimock.Equal(e.params, mmGetPreviewByTagID.defaultExpectation.params) {
+			mmGetPreviewByTagID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetPreviewByTagID.defaultExpectation.params)
+		}
+	}
+
+	return mmGetPreviewByTagID
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.GetPreviewByTagID
+func (mmGetPreviewByTagID *mIArticleRepositoryMockGetPreviewByTagID) Inspect(f func(ctx context.Context, tagID int)) *mIArticleRepositoryMockGetPreviewByTagID {
+	if mmGetPreviewByTagID.mock.inspectFuncGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.GetPreviewByTagID")
+	}
+
+	mmGetPreviewByTagID.mock.inspectFuncGetPreviewByTagID = f
+
+	return mmGetPreviewByTagID
+}
+
+// Return sets up results that will be returned by IArticleRepository.GetPreviewByTagID
+func (mmGetPreviewByTagID *mIArticleRepositoryMockGetPreviewByTagID) Return(aa1 []models.ArticlePreview, err error) *IArticleRepositoryMock {
+	if mmGetPreviewByTagID.mock.funcGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("IArticleRepositoryMock.GetPreviewByTagID mock is already set by Set")
+	}
+
+	if mmGetPreviewByTagID.defaultExpectation == nil {
+		mmGetPreviewByTagID.defaultExpectation = &IArticleRepositoryMockGetPreviewByTagIDExpectation{mock: mmGetPreviewByTagID.mock}
+	}
+	mmGetPreviewByTagID.defaultExpectation.results = &IArticleRepositoryMockGetPreviewByTagIDResults{aa1, err}
+	return mmGetPreviewByTagID.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.GetPreviewByTagID method
+func (mmGetPreviewByTagID *mIArticleRepositoryMockGetPreviewByTagID) Set(f func(ctx context.Context, tagID int) (aa1 []models.ArticlePreview, err error)) *IArticleRepositoryMock {
+	if mmGetPreviewByTagID.defaultExpectation != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.GetPreviewByTagID method")
+	}
+
+	if len(mmGetPreviewByTagID.expectations) > 0 {
+		mmGetPreviewByTagID.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.GetPreviewByTagID method")
+	}
+
+	mmGetPreviewByTagID.mock.funcGetPreviewByTagID = f
+	return mmGetPreviewByTagID.mock
+}
+
+// When sets expectation for the IArticleRepository.GetPreviewByTagID which will trigger the result defined by the following
+// Then helper
+func (mmGetPreviewByTagID *mIArticleRepositoryMockGetPreviewByTagID) When(ctx context.Context, tagID int) *IArticleRepositoryMockGetPreviewByTagIDExpectation {
+	if mmGetPreviewByTagID.mock.funcGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("IArticleRepositoryMock.GetPreviewByTagID mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockGetPreviewByTagIDExpectation{
+		mock:   mmGetPreviewByTagID.mock,
+		params: &IArticleRepositoryMockGetPreviewByTagIDParams{ctx, tagID},
+	}
+	mmGetPreviewByTagID.expectations = append(mmGetPreviewByTagID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.GetPreviewByTagID return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockGetPreviewByTagIDExpectation) Then(aa1 []models.ArticlePreview, err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockGetPreviewByTagIDResults{aa1, err}
+	return e.mock
+}
+
+// GetPreviewByTagID implements interfaces.IArticleRepository
+func (mmGetPreviewByTagID *IArticleRepositoryMock) GetPreviewByTagID(ctx context.Context, tagID int) (aa1 []models.ArticlePreview, err error) {
+	mm_atomic.AddUint64(&mmGetPreviewByTagID.beforeGetPreviewByTagIDCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetPreviewByTagID.afterGetPreviewByTagIDCounter, 1)
+
+	if mmGetPreviewByTagID.inspectFuncGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.inspectFuncGetPreviewByTagID(ctx, tagID)
+	}
+
+	mm_params := &IArticleRepositoryMockGetPreviewByTagIDParams{ctx, tagID}
+
+	// Record call args
+	mmGetPreviewByTagID.GetPreviewByTagIDMock.mutex.Lock()
+	mmGetPreviewByTagID.GetPreviewByTagIDMock.callArgs = append(mmGetPreviewByTagID.GetPreviewByTagIDMock.callArgs, mm_params)
+	mmGetPreviewByTagID.GetPreviewByTagIDMock.mutex.Unlock()
+
+	for _, e := range mmGetPreviewByTagID.GetPreviewByTagIDMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.aa1, e.results.err
+		}
+	}
+
+	if mmGetPreviewByTagID.GetPreviewByTagIDMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetPreviewByTagID.GetPreviewByTagIDMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetPreviewByTagID.GetPreviewByTagIDMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockGetPreviewByTagIDParams{ctx, tagID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetPreviewByTagID.t.Errorf("IArticleRepositoryMock.GetPreviewByTagID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetPreviewByTagID.GetPreviewByTagIDMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetPreviewByTagID.t.Fatal("No results are set for the IArticleRepositoryMock.GetPreviewByTagID")
+		}
+		return (*mm_results).aa1, (*mm_results).err
+	}
+	if mmGetPreviewByTagID.funcGetPreviewByTagID != nil {
+		return mmGetPreviewByTagID.funcGetPreviewByTagID(ctx, tagID)
+	}
+	mmGetPreviewByTagID.t.Fatalf("Unexpected call to IArticleRepositoryMock.GetPreviewByTagID. %v %v", ctx, tagID)
+	return
+}
+
+// GetPreviewByTagIDAfterCounter returns a count of finished IArticleRepositoryMock.GetPreviewByTagID invocations
+func (mmGetPreviewByTagID *IArticleRepositoryMock) GetPreviewByTagIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetPreviewByTagID.afterGetPreviewByTagIDCounter)
+}
+
+// GetPreviewByTagIDBeforeCounter returns a count of IArticleRepositoryMock.GetPreviewByTagID invocations
+func (mmGetPreviewByTagID *IArticleRepositoryMock) GetPreviewByTagIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetPreviewByTagID.beforeGetPreviewByTagIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.GetPreviewByTagID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetPreviewByTagID *mIArticleRepositoryMockGetPreviewByTagID) Calls() []*IArticleRepositoryMockGetPreviewByTagIDParams {
+	mmGetPreviewByTagID.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockGetPreviewByTagIDParams, len(mmGetPreviewByTagID.callArgs))
+	copy(argCopy, mmGetPreviewByTagID.callArgs)
+
+	mmGetPreviewByTagID.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetPreviewByTagIDDone returns true if the count of the GetPreviewByTagID invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockGetPreviewByTagIDDone() bool {
+	for _, e := range m.GetPreviewByTagIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetPreviewByTagIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetPreviewByTagIDCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetPreviewByTagID != nil && mm_atomic.LoadUint64(&m.afterGetPreviewByTagIDCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetPreviewByTagIDInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockGetPreviewByTagIDInspect() {
+	for _, e := range m.GetPreviewByTagIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetPreviewByTagID with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetPreviewByTagIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetPreviewByTagIDCounter) < 1 {
+		if m.GetPreviewByTagIDMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.GetPreviewByTagID")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.GetPreviewByTagID with params: %#v", *m.GetPreviewByTagIDMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetPreviewByTagID != nil && mm_atomic.LoadUint64(&m.afterGetPreviewByTagIDCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.GetPreviewByTagID")
+	}
+}
+
+type mIArticleRepositoryMockUpdate struct {
+	mock               *IArticleRepositoryMock
+	defaultExpectation *IArticleRepositoryMockUpdateExpectation
+	expectations       []*IArticleRepositoryMockUpdateExpectation
+
+	callArgs []*IArticleRepositoryMockUpdateParams
+	mutex    sync.RWMutex
+}
+
+// IArticleRepositoryMockUpdateExpectation specifies expectation struct of the IArticleRepository.Update
+type IArticleRepositoryMockUpdateExpectation struct {
+	mock    *IArticleRepositoryMock
+	params  *IArticleRepositoryMockUpdateParams
+	results *IArticleRepositoryMockUpdateResults
+	Counter uint64
+}
+
+// IArticleRepositoryMockUpdateParams contains parameters of the IArticleRepository.Update
+type IArticleRepositoryMockUpdateParams struct {
+	ctx context.Context
+	m   models.Article
+}
+
+// IArticleRepositoryMockUpdateResults contains results of the IArticleRepository.Update
+type IArticleRepositoryMockUpdateResults struct {
+	err error
+}
+
+// Expect sets up expected params for IArticleRepository.Update
+func (mmUpdate *mIArticleRepositoryMockUpdate) Expect(ctx context.Context, m models.Article) *mIArticleRepositoryMockUpdate {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("IArticleRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &IArticleRepositoryMockUpdateExpectation{}
+	}
+
+	mmUpdate.defaultExpectation.params = &IArticleRepositoryMockUpdateParams{ctx, m}
+	for _, e := range mmUpdate.expectations {
+		if minimock.Equal(e.params, mmUpdate.defaultExpectation.params) {
+			mmUpdate.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdate.defaultExpectation.params)
+		}
+	}
+
+	return mmUpdate
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleRepository.Update
+func (mmUpdate *mIArticleRepositoryMockUpdate) Inspect(f func(ctx context.Context, m models.Article)) *mIArticleRepositoryMockUpdate {
+	if mmUpdate.mock.inspectFuncUpdate != nil {
+		mmUpdate.mock.t.Fatalf("Inspect function is already set for IArticleRepositoryMock.Update")
+	}
+
+	mmUpdate.mock.inspectFuncUpdate = f
+
+	return mmUpdate
+}
+
+// Return sets up results that will be returned by IArticleRepository.Update
+func (mmUpdate *mIArticleRepositoryMockUpdate) Return(err error) *IArticleRepositoryMock {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("IArticleRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &IArticleRepositoryMockUpdateExpectation{mock: mmUpdate.mock}
+	}
+	mmUpdate.defaultExpectation.results = &IArticleRepositoryMockUpdateResults{err}
+	return mmUpdate.mock
+}
+
+//Set uses given function f to mock the IArticleRepository.Update method
+func (mmUpdate *mIArticleRepositoryMockUpdate) Set(f func(ctx context.Context, m models.Article) (err error)) *IArticleRepositoryMock {
+	if mmUpdate.defaultExpectation != nil {
+		mmUpdate.mock.t.Fatalf("Default expectation is already set for the IArticleRepository.Update method")
+	}
+
+	if len(mmUpdate.expectations) > 0 {
+		mmUpdate.mock.t.Fatalf("Some expectations are already set for the IArticleRepository.Update method")
+	}
+
+	mmUpdate.mock.funcUpdate = f
+	return mmUpdate.mock
+}
+
+// When sets expectation for the IArticleRepository.Update which will trigger the result defined by the following
+// Then helper
+func (mmUpdate *mIArticleRepositoryMockUpdate) When(ctx context.Context, m models.Article) *IArticleRepositoryMockUpdateExpectation {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("IArticleRepositoryMock.Update mock is already set by Set")
+	}
+
+	expectation := &IArticleRepositoryMockUpdateExpectation{
+		mock:   mmUpdate.mock,
+		params: &IArticleRepositoryMockUpdateParams{ctx, m},
+	}
+	mmUpdate.expectations = append(mmUpdate.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleRepository.Update return parameters for the expectation previously defined by the When method
+func (e *IArticleRepositoryMockUpdateExpectation) Then(err error) *IArticleRepositoryMock {
+	e.results = &IArticleRepositoryMockUpdateResults{err}
+	return e.mock
+}
+
+// Update implements interfaces.IArticleRepository
+func (mmUpdate *IArticleRepositoryMock) Update(ctx context.Context, m models.Article) (err error) {
+	mm_atomic.AddUint64(&mmUpdate.beforeUpdateCounter, 1)
+	defer mm_atomic.AddUint64(&mmUpdate.afterUpdateCounter, 1)
+
+	if mmUpdate.inspectFuncUpdate != nil {
+		mmUpdate.inspectFuncUpdate(ctx, m)
+	}
+
+	mm_params := &IArticleRepositoryMockUpdateParams{ctx, m}
+
+	// Record call args
+	mmUpdate.UpdateMock.mutex.Lock()
+	mmUpdate.UpdateMock.callArgs = append(mmUpdate.UpdateMock.callArgs, mm_params)
+	mmUpdate.UpdateMock.mutex.Unlock()
+
+	for _, e := range mmUpdate.UpdateMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmUpdate.UpdateMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmUpdate.UpdateMock.defaultExpectation.Counter, 1)
+		mm_want := mmUpdate.UpdateMock.defaultExpectation.params
+		mm_got := IArticleRepositoryMockUpdateParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmUpdate.t.Errorf("IArticleRepositoryMock.Update got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmUpdate.UpdateMock.defaultExpectation.results
+		if mm_results == nil {
+			mmUpdate.t.Fatal("No results are set for the IArticleRepositoryMock.Update")
+		}
+		return (*mm_results).err
+	}
+	if mmUpdate.funcUpdate != nil {
+		return mmUpdate.funcUpdate(ctx, m)
+	}
+	mmUpdate.t.Fatalf("Unexpected call to IArticleRepositoryMock.Update. %v %v", ctx, m)
+	return
+}
+
+// UpdateAfterCounter returns a count of finished IArticleRepositoryMock.Update invocations
+func (mmUpdate *IArticleRepositoryMock) UpdateAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.afterUpdateCounter)
+}
+
+// UpdateBeforeCounter returns a count of IArticleRepositoryMock.Update invocations
+func (mmUpdate *IArticleRepositoryMock) UpdateBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.beforeUpdateCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleRepositoryMock.Update.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmUpdate *mIArticleRepositoryMockUpdate) Calls() []*IArticleRepositoryMockUpdateParams {
+	mmUpdate.mutex.RLock()
+
+	argCopy := make([]*IArticleRepositoryMockUpdateParams, len(mmUpdate.callArgs))
+	copy(argCopy, mmUpdate.callArgs)
+
+	mmUpdate.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockUpdateDone returns true if the count of the Update invocations corresponds
+// the number of defined expectations
+func (m *IArticleRepositoryMock) MinimockUpdateDone() bool {
+	for _, e := range m.UpdateMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.UpdateMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcUpdate != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockUpdateInspect logs each unmet expectation
+func (m *IArticleRepositoryMock) MinimockUpdateInspect() {
+	for _, e := range m.UpdateMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.Update with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.UpdateMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		if m.UpdateMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleRepositoryMock.Update")
+		} else {
+			m.t.Errorf("Expected call to IArticleRepositoryMock.Update with params: %#v", *m.UpdateMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcUpdate != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		m.t.Error("Expected call to IArticleRepositoryMock.Update")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *IArticleRepositoryMock) MinimockFinish() {
+	if !m.minimockDone() {
+		m.MinimockAddInspect()
+
+		m.MinimockDeleteInspect()
+
+		m.MinimockGetAllInspect()
+
+		m.MinimockGetAllPreviewInspect()
+
+		m.MinimockGetByIDInspect()
+
+		m.MinimockGetByURLInspect()
+
+		m.MinimockGetPreviewByTagIDInspect()
+
+		m.MinimockUpdateInspect()
+		m.t.FailNow()
+	}
+}
+
+// MinimockWait waits for all mocked methods to be called the expected number of times
+func (m *IArticleRepositoryMock) MinimockWait(timeout mm_time.Duration) {
+	timeoutCh := mm_time.After(timeout)
+	for {
+		if m.minimockDone() {
+			return
+		}
+		select {
+		case <-timeoutCh:
+			m.MinimockFinish()
+			return
+		case <-mm_time.After(10 * mm_time.Millisecond):
+		}
+	}
+}
+
+func (m *IArticleRepositoryMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockAddDone() &&
+		m.MinimockDeleteDone() &&
+		m.MinimockGetAllDone() &&
+		m.MinimockGetAllPreviewDone() &&
+		m.MinimockGetByIDDone() &&
+		m.MinimockGetByURLDone() &&
+		m.MinimockGetPreviewByTagIDDone() &&
+		m.MinimockUpdateDone()
+}

+ 742 - 0
internal/repositories/mocks/i_article_tag_repository_minimock.go

@@ -0,0 +1,742 @@
+package mocks
+
+// Code generated by http://github.com/gojuno/minimock (dev). DO NOT EDIT.
+
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.IArticleTagRepository -o ./mocks/i_article_tag_repository_minimock.go -n IArticleTagRepositoryMock
+
+import (
+	"context"
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/gojuno/minimock/v3"
+)
+
+// IArticleTagRepositoryMock implements interfaces.IArticleTagRepository
+type IArticleTagRepositoryMock struct {
+	t minimock.Tester
+
+	funcAdd          func(ctx context.Context, articleID int, tagIDs []int) (err error)
+	inspectFuncAdd   func(ctx context.Context, articleID int, tagIDs []int)
+	afterAddCounter  uint64
+	beforeAddCounter uint64
+	AddMock          mIArticleTagRepositoryMockAdd
+
+	funcDelete          func(ctx context.Context, articleID int, tagIDs []int) (err error)
+	inspectFuncDelete   func(ctx context.Context, articleID int, tagIDs []int)
+	afterDeleteCounter  uint64
+	beforeDeleteCounter uint64
+	DeleteMock          mIArticleTagRepositoryMockDelete
+
+	funcDeleteByArticleID          func(ctx context.Context, articleID int) (err error)
+	inspectFuncDeleteByArticleID   func(ctx context.Context, articleID int)
+	afterDeleteByArticleIDCounter  uint64
+	beforeDeleteByArticleIDCounter uint64
+	DeleteByArticleIDMock          mIArticleTagRepositoryMockDeleteByArticleID
+}
+
+// NewIArticleTagRepositoryMock returns a mock for interfaces.IArticleTagRepository
+func NewIArticleTagRepositoryMock(t minimock.Tester) *IArticleTagRepositoryMock {
+	m := &IArticleTagRepositoryMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.AddMock = mIArticleTagRepositoryMockAdd{mock: m}
+	m.AddMock.callArgs = []*IArticleTagRepositoryMockAddParams{}
+
+	m.DeleteMock = mIArticleTagRepositoryMockDelete{mock: m}
+	m.DeleteMock.callArgs = []*IArticleTagRepositoryMockDeleteParams{}
+
+	m.DeleteByArticleIDMock = mIArticleTagRepositoryMockDeleteByArticleID{mock: m}
+	m.DeleteByArticleIDMock.callArgs = []*IArticleTagRepositoryMockDeleteByArticleIDParams{}
+
+	return m
+}
+
+type mIArticleTagRepositoryMockAdd struct {
+	mock               *IArticleTagRepositoryMock
+	defaultExpectation *IArticleTagRepositoryMockAddExpectation
+	expectations       []*IArticleTagRepositoryMockAddExpectation
+
+	callArgs []*IArticleTagRepositoryMockAddParams
+	mutex    sync.RWMutex
+}
+
+// IArticleTagRepositoryMockAddExpectation specifies expectation struct of the IArticleTagRepository.Add
+type IArticleTagRepositoryMockAddExpectation struct {
+	mock    *IArticleTagRepositoryMock
+	params  *IArticleTagRepositoryMockAddParams
+	results *IArticleTagRepositoryMockAddResults
+	Counter uint64
+}
+
+// IArticleTagRepositoryMockAddParams contains parameters of the IArticleTagRepository.Add
+type IArticleTagRepositoryMockAddParams struct {
+	ctx       context.Context
+	articleID int
+	tagIDs    []int
+}
+
+// IArticleTagRepositoryMockAddResults contains results of the IArticleTagRepository.Add
+type IArticleTagRepositoryMockAddResults struct {
+	err error
+}
+
+// Expect sets up expected params for IArticleTagRepository.Add
+func (mmAdd *mIArticleTagRepositoryMockAdd) Expect(ctx context.Context, articleID int, tagIDs []int) *mIArticleTagRepositoryMockAdd {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("IArticleTagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &IArticleTagRepositoryMockAddExpectation{}
+	}
+
+	mmAdd.defaultExpectation.params = &IArticleTagRepositoryMockAddParams{ctx, articleID, tagIDs}
+	for _, e := range mmAdd.expectations {
+		if minimock.Equal(e.params, mmAdd.defaultExpectation.params) {
+			mmAdd.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmAdd.defaultExpectation.params)
+		}
+	}
+
+	return mmAdd
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleTagRepository.Add
+func (mmAdd *mIArticleTagRepositoryMockAdd) Inspect(f func(ctx context.Context, articleID int, tagIDs []int)) *mIArticleTagRepositoryMockAdd {
+	if mmAdd.mock.inspectFuncAdd != nil {
+		mmAdd.mock.t.Fatalf("Inspect function is already set for IArticleTagRepositoryMock.Add")
+	}
+
+	mmAdd.mock.inspectFuncAdd = f
+
+	return mmAdd
+}
+
+// Return sets up results that will be returned by IArticleTagRepository.Add
+func (mmAdd *mIArticleTagRepositoryMockAdd) Return(err error) *IArticleTagRepositoryMock {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("IArticleTagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &IArticleTagRepositoryMockAddExpectation{mock: mmAdd.mock}
+	}
+	mmAdd.defaultExpectation.results = &IArticleTagRepositoryMockAddResults{err}
+	return mmAdd.mock
+}
+
+//Set uses given function f to mock the IArticleTagRepository.Add method
+func (mmAdd *mIArticleTagRepositoryMockAdd) Set(f func(ctx context.Context, articleID int, tagIDs []int) (err error)) *IArticleTagRepositoryMock {
+	if mmAdd.defaultExpectation != nil {
+		mmAdd.mock.t.Fatalf("Default expectation is already set for the IArticleTagRepository.Add method")
+	}
+
+	if len(mmAdd.expectations) > 0 {
+		mmAdd.mock.t.Fatalf("Some expectations are already set for the IArticleTagRepository.Add method")
+	}
+
+	mmAdd.mock.funcAdd = f
+	return mmAdd.mock
+}
+
+// When sets expectation for the IArticleTagRepository.Add which will trigger the result defined by the following
+// Then helper
+func (mmAdd *mIArticleTagRepositoryMockAdd) When(ctx context.Context, articleID int, tagIDs []int) *IArticleTagRepositoryMockAddExpectation {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("IArticleTagRepositoryMock.Add mock is already set by Set")
+	}
+
+	expectation := &IArticleTagRepositoryMockAddExpectation{
+		mock:   mmAdd.mock,
+		params: &IArticleTagRepositoryMockAddParams{ctx, articleID, tagIDs},
+	}
+	mmAdd.expectations = append(mmAdd.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleTagRepository.Add return parameters for the expectation previously defined by the When method
+func (e *IArticleTagRepositoryMockAddExpectation) Then(err error) *IArticleTagRepositoryMock {
+	e.results = &IArticleTagRepositoryMockAddResults{err}
+	return e.mock
+}
+
+// Add implements interfaces.IArticleTagRepository
+func (mmAdd *IArticleTagRepositoryMock) Add(ctx context.Context, articleID int, tagIDs []int) (err error) {
+	mm_atomic.AddUint64(&mmAdd.beforeAddCounter, 1)
+	defer mm_atomic.AddUint64(&mmAdd.afterAddCounter, 1)
+
+	if mmAdd.inspectFuncAdd != nil {
+		mmAdd.inspectFuncAdd(ctx, articleID, tagIDs)
+	}
+
+	mm_params := &IArticleTagRepositoryMockAddParams{ctx, articleID, tagIDs}
+
+	// Record call args
+	mmAdd.AddMock.mutex.Lock()
+	mmAdd.AddMock.callArgs = append(mmAdd.AddMock.callArgs, mm_params)
+	mmAdd.AddMock.mutex.Unlock()
+
+	for _, e := range mmAdd.AddMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmAdd.AddMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmAdd.AddMock.defaultExpectation.Counter, 1)
+		mm_want := mmAdd.AddMock.defaultExpectation.params
+		mm_got := IArticleTagRepositoryMockAddParams{ctx, articleID, tagIDs}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmAdd.t.Errorf("IArticleTagRepositoryMock.Add got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmAdd.AddMock.defaultExpectation.results
+		if mm_results == nil {
+			mmAdd.t.Fatal("No results are set for the IArticleTagRepositoryMock.Add")
+		}
+		return (*mm_results).err
+	}
+	if mmAdd.funcAdd != nil {
+		return mmAdd.funcAdd(ctx, articleID, tagIDs)
+	}
+	mmAdd.t.Fatalf("Unexpected call to IArticleTagRepositoryMock.Add. %v %v %v", ctx, articleID, tagIDs)
+	return
+}
+
+// AddAfterCounter returns a count of finished IArticleTagRepositoryMock.Add invocations
+func (mmAdd *IArticleTagRepositoryMock) AddAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.afterAddCounter)
+}
+
+// AddBeforeCounter returns a count of IArticleTagRepositoryMock.Add invocations
+func (mmAdd *IArticleTagRepositoryMock) AddBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.beforeAddCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleTagRepositoryMock.Add.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmAdd *mIArticleTagRepositoryMockAdd) Calls() []*IArticleTagRepositoryMockAddParams {
+	mmAdd.mutex.RLock()
+
+	argCopy := make([]*IArticleTagRepositoryMockAddParams, len(mmAdd.callArgs))
+	copy(argCopy, mmAdd.callArgs)
+
+	mmAdd.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockAddDone returns true if the count of the Add invocations corresponds
+// the number of defined expectations
+func (m *IArticleTagRepositoryMock) MinimockAddDone() bool {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.AddMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcAdd != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockAddInspect logs each unmet expectation
+func (m *IArticleTagRepositoryMock) MinimockAddInspect() {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleTagRepositoryMock.Add with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.AddMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		if m.AddMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleTagRepositoryMock.Add")
+		} else {
+			m.t.Errorf("Expected call to IArticleTagRepositoryMock.Add with params: %#v", *m.AddMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcAdd != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		m.t.Error("Expected call to IArticleTagRepositoryMock.Add")
+	}
+}
+
+type mIArticleTagRepositoryMockDelete struct {
+	mock               *IArticleTagRepositoryMock
+	defaultExpectation *IArticleTagRepositoryMockDeleteExpectation
+	expectations       []*IArticleTagRepositoryMockDeleteExpectation
+
+	callArgs []*IArticleTagRepositoryMockDeleteParams
+	mutex    sync.RWMutex
+}
+
+// IArticleTagRepositoryMockDeleteExpectation specifies expectation struct of the IArticleTagRepository.Delete
+type IArticleTagRepositoryMockDeleteExpectation struct {
+	mock    *IArticleTagRepositoryMock
+	params  *IArticleTagRepositoryMockDeleteParams
+	results *IArticleTagRepositoryMockDeleteResults
+	Counter uint64
+}
+
+// IArticleTagRepositoryMockDeleteParams contains parameters of the IArticleTagRepository.Delete
+type IArticleTagRepositoryMockDeleteParams struct {
+	ctx       context.Context
+	articleID int
+	tagIDs    []int
+}
+
+// IArticleTagRepositoryMockDeleteResults contains results of the IArticleTagRepository.Delete
+type IArticleTagRepositoryMockDeleteResults struct {
+	err error
+}
+
+// Expect sets up expected params for IArticleTagRepository.Delete
+func (mmDelete *mIArticleTagRepositoryMockDelete) Expect(ctx context.Context, articleID int, tagIDs []int) *mIArticleTagRepositoryMockDelete {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("IArticleTagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &IArticleTagRepositoryMockDeleteExpectation{}
+	}
+
+	mmDelete.defaultExpectation.params = &IArticleTagRepositoryMockDeleteParams{ctx, articleID, tagIDs}
+	for _, e := range mmDelete.expectations {
+		if minimock.Equal(e.params, mmDelete.defaultExpectation.params) {
+			mmDelete.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDelete.defaultExpectation.params)
+		}
+	}
+
+	return mmDelete
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleTagRepository.Delete
+func (mmDelete *mIArticleTagRepositoryMockDelete) Inspect(f func(ctx context.Context, articleID int, tagIDs []int)) *mIArticleTagRepositoryMockDelete {
+	if mmDelete.mock.inspectFuncDelete != nil {
+		mmDelete.mock.t.Fatalf("Inspect function is already set for IArticleTagRepositoryMock.Delete")
+	}
+
+	mmDelete.mock.inspectFuncDelete = f
+
+	return mmDelete
+}
+
+// Return sets up results that will be returned by IArticleTagRepository.Delete
+func (mmDelete *mIArticleTagRepositoryMockDelete) Return(err error) *IArticleTagRepositoryMock {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("IArticleTagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &IArticleTagRepositoryMockDeleteExpectation{mock: mmDelete.mock}
+	}
+	mmDelete.defaultExpectation.results = &IArticleTagRepositoryMockDeleteResults{err}
+	return mmDelete.mock
+}
+
+//Set uses given function f to mock the IArticleTagRepository.Delete method
+func (mmDelete *mIArticleTagRepositoryMockDelete) Set(f func(ctx context.Context, articleID int, tagIDs []int) (err error)) *IArticleTagRepositoryMock {
+	if mmDelete.defaultExpectation != nil {
+		mmDelete.mock.t.Fatalf("Default expectation is already set for the IArticleTagRepository.Delete method")
+	}
+
+	if len(mmDelete.expectations) > 0 {
+		mmDelete.mock.t.Fatalf("Some expectations are already set for the IArticleTagRepository.Delete method")
+	}
+
+	mmDelete.mock.funcDelete = f
+	return mmDelete.mock
+}
+
+// When sets expectation for the IArticleTagRepository.Delete which will trigger the result defined by the following
+// Then helper
+func (mmDelete *mIArticleTagRepositoryMockDelete) When(ctx context.Context, articleID int, tagIDs []int) *IArticleTagRepositoryMockDeleteExpectation {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("IArticleTagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	expectation := &IArticleTagRepositoryMockDeleteExpectation{
+		mock:   mmDelete.mock,
+		params: &IArticleTagRepositoryMockDeleteParams{ctx, articleID, tagIDs},
+	}
+	mmDelete.expectations = append(mmDelete.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleTagRepository.Delete return parameters for the expectation previously defined by the When method
+func (e *IArticleTagRepositoryMockDeleteExpectation) Then(err error) *IArticleTagRepositoryMock {
+	e.results = &IArticleTagRepositoryMockDeleteResults{err}
+	return e.mock
+}
+
+// Delete implements interfaces.IArticleTagRepository
+func (mmDelete *IArticleTagRepositoryMock) Delete(ctx context.Context, articleID int, tagIDs []int) (err error) {
+	mm_atomic.AddUint64(&mmDelete.beforeDeleteCounter, 1)
+	defer mm_atomic.AddUint64(&mmDelete.afterDeleteCounter, 1)
+
+	if mmDelete.inspectFuncDelete != nil {
+		mmDelete.inspectFuncDelete(ctx, articleID, tagIDs)
+	}
+
+	mm_params := &IArticleTagRepositoryMockDeleteParams{ctx, articleID, tagIDs}
+
+	// Record call args
+	mmDelete.DeleteMock.mutex.Lock()
+	mmDelete.DeleteMock.callArgs = append(mmDelete.DeleteMock.callArgs, mm_params)
+	mmDelete.DeleteMock.mutex.Unlock()
+
+	for _, e := range mmDelete.DeleteMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmDelete.DeleteMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmDelete.DeleteMock.defaultExpectation.Counter, 1)
+		mm_want := mmDelete.DeleteMock.defaultExpectation.params
+		mm_got := IArticleTagRepositoryMockDeleteParams{ctx, articleID, tagIDs}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDelete.t.Errorf("IArticleTagRepositoryMock.Delete got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmDelete.DeleteMock.defaultExpectation.results
+		if mm_results == nil {
+			mmDelete.t.Fatal("No results are set for the IArticleTagRepositoryMock.Delete")
+		}
+		return (*mm_results).err
+	}
+	if mmDelete.funcDelete != nil {
+		return mmDelete.funcDelete(ctx, articleID, tagIDs)
+	}
+	mmDelete.t.Fatalf("Unexpected call to IArticleTagRepositoryMock.Delete. %v %v %v", ctx, articleID, tagIDs)
+	return
+}
+
+// DeleteAfterCounter returns a count of finished IArticleTagRepositoryMock.Delete invocations
+func (mmDelete *IArticleTagRepositoryMock) DeleteAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.afterDeleteCounter)
+}
+
+// DeleteBeforeCounter returns a count of IArticleTagRepositoryMock.Delete invocations
+func (mmDelete *IArticleTagRepositoryMock) DeleteBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.beforeDeleteCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleTagRepositoryMock.Delete.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDelete *mIArticleTagRepositoryMockDelete) Calls() []*IArticleTagRepositoryMockDeleteParams {
+	mmDelete.mutex.RLock()
+
+	argCopy := make([]*IArticleTagRepositoryMockDeleteParams, len(mmDelete.callArgs))
+	copy(argCopy, mmDelete.callArgs)
+
+	mmDelete.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockDeleteDone returns true if the count of the Delete invocations corresponds
+// the number of defined expectations
+func (m *IArticleTagRepositoryMock) MinimockDeleteDone() bool {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDelete != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockDeleteInspect logs each unmet expectation
+func (m *IArticleTagRepositoryMock) MinimockDeleteInspect() {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleTagRepositoryMock.Delete with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		if m.DeleteMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleTagRepositoryMock.Delete")
+		} else {
+			m.t.Errorf("Expected call to IArticleTagRepositoryMock.Delete with params: %#v", *m.DeleteMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDelete != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		m.t.Error("Expected call to IArticleTagRepositoryMock.Delete")
+	}
+}
+
+type mIArticleTagRepositoryMockDeleteByArticleID struct {
+	mock               *IArticleTagRepositoryMock
+	defaultExpectation *IArticleTagRepositoryMockDeleteByArticleIDExpectation
+	expectations       []*IArticleTagRepositoryMockDeleteByArticleIDExpectation
+
+	callArgs []*IArticleTagRepositoryMockDeleteByArticleIDParams
+	mutex    sync.RWMutex
+}
+
+// IArticleTagRepositoryMockDeleteByArticleIDExpectation specifies expectation struct of the IArticleTagRepository.DeleteByArticleID
+type IArticleTagRepositoryMockDeleteByArticleIDExpectation struct {
+	mock    *IArticleTagRepositoryMock
+	params  *IArticleTagRepositoryMockDeleteByArticleIDParams
+	results *IArticleTagRepositoryMockDeleteByArticleIDResults
+	Counter uint64
+}
+
+// IArticleTagRepositoryMockDeleteByArticleIDParams contains parameters of the IArticleTagRepository.DeleteByArticleID
+type IArticleTagRepositoryMockDeleteByArticleIDParams struct {
+	ctx       context.Context
+	articleID int
+}
+
+// IArticleTagRepositoryMockDeleteByArticleIDResults contains results of the IArticleTagRepository.DeleteByArticleID
+type IArticleTagRepositoryMockDeleteByArticleIDResults struct {
+	err error
+}
+
+// Expect sets up expected params for IArticleTagRepository.DeleteByArticleID
+func (mmDeleteByArticleID *mIArticleTagRepositoryMockDeleteByArticleID) Expect(ctx context.Context, articleID int) *mIArticleTagRepositoryMockDeleteByArticleID {
+	if mmDeleteByArticleID.mock.funcDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("IArticleTagRepositoryMock.DeleteByArticleID mock is already set by Set")
+	}
+
+	if mmDeleteByArticleID.defaultExpectation == nil {
+		mmDeleteByArticleID.defaultExpectation = &IArticleTagRepositoryMockDeleteByArticleIDExpectation{}
+	}
+
+	mmDeleteByArticleID.defaultExpectation.params = &IArticleTagRepositoryMockDeleteByArticleIDParams{ctx, articleID}
+	for _, e := range mmDeleteByArticleID.expectations {
+		if minimock.Equal(e.params, mmDeleteByArticleID.defaultExpectation.params) {
+			mmDeleteByArticleID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteByArticleID.defaultExpectation.params)
+		}
+	}
+
+	return mmDeleteByArticleID
+}
+
+// Inspect accepts an inspector function that has same arguments as the IArticleTagRepository.DeleteByArticleID
+func (mmDeleteByArticleID *mIArticleTagRepositoryMockDeleteByArticleID) Inspect(f func(ctx context.Context, articleID int)) *mIArticleTagRepositoryMockDeleteByArticleID {
+	if mmDeleteByArticleID.mock.inspectFuncDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("Inspect function is already set for IArticleTagRepositoryMock.DeleteByArticleID")
+	}
+
+	mmDeleteByArticleID.mock.inspectFuncDeleteByArticleID = f
+
+	return mmDeleteByArticleID
+}
+
+// Return sets up results that will be returned by IArticleTagRepository.DeleteByArticleID
+func (mmDeleteByArticleID *mIArticleTagRepositoryMockDeleteByArticleID) Return(err error) *IArticleTagRepositoryMock {
+	if mmDeleteByArticleID.mock.funcDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("IArticleTagRepositoryMock.DeleteByArticleID mock is already set by Set")
+	}
+
+	if mmDeleteByArticleID.defaultExpectation == nil {
+		mmDeleteByArticleID.defaultExpectation = &IArticleTagRepositoryMockDeleteByArticleIDExpectation{mock: mmDeleteByArticleID.mock}
+	}
+	mmDeleteByArticleID.defaultExpectation.results = &IArticleTagRepositoryMockDeleteByArticleIDResults{err}
+	return mmDeleteByArticleID.mock
+}
+
+//Set uses given function f to mock the IArticleTagRepository.DeleteByArticleID method
+func (mmDeleteByArticleID *mIArticleTagRepositoryMockDeleteByArticleID) Set(f func(ctx context.Context, articleID int) (err error)) *IArticleTagRepositoryMock {
+	if mmDeleteByArticleID.defaultExpectation != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("Default expectation is already set for the IArticleTagRepository.DeleteByArticleID method")
+	}
+
+	if len(mmDeleteByArticleID.expectations) > 0 {
+		mmDeleteByArticleID.mock.t.Fatalf("Some expectations are already set for the IArticleTagRepository.DeleteByArticleID method")
+	}
+
+	mmDeleteByArticleID.mock.funcDeleteByArticleID = f
+	return mmDeleteByArticleID.mock
+}
+
+// When sets expectation for the IArticleTagRepository.DeleteByArticleID which will trigger the result defined by the following
+// Then helper
+func (mmDeleteByArticleID *mIArticleTagRepositoryMockDeleteByArticleID) When(ctx context.Context, articleID int) *IArticleTagRepositoryMockDeleteByArticleIDExpectation {
+	if mmDeleteByArticleID.mock.funcDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("IArticleTagRepositoryMock.DeleteByArticleID mock is already set by Set")
+	}
+
+	expectation := &IArticleTagRepositoryMockDeleteByArticleIDExpectation{
+		mock:   mmDeleteByArticleID.mock,
+		params: &IArticleTagRepositoryMockDeleteByArticleIDParams{ctx, articleID},
+	}
+	mmDeleteByArticleID.expectations = append(mmDeleteByArticleID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IArticleTagRepository.DeleteByArticleID return parameters for the expectation previously defined by the When method
+func (e *IArticleTagRepositoryMockDeleteByArticleIDExpectation) Then(err error) *IArticleTagRepositoryMock {
+	e.results = &IArticleTagRepositoryMockDeleteByArticleIDResults{err}
+	return e.mock
+}
+
+// DeleteByArticleID implements interfaces.IArticleTagRepository
+func (mmDeleteByArticleID *IArticleTagRepositoryMock) DeleteByArticleID(ctx context.Context, articleID int) (err error) {
+	mm_atomic.AddUint64(&mmDeleteByArticleID.beforeDeleteByArticleIDCounter, 1)
+	defer mm_atomic.AddUint64(&mmDeleteByArticleID.afterDeleteByArticleIDCounter, 1)
+
+	if mmDeleteByArticleID.inspectFuncDeleteByArticleID != nil {
+		mmDeleteByArticleID.inspectFuncDeleteByArticleID(ctx, articleID)
+	}
+
+	mm_params := &IArticleTagRepositoryMockDeleteByArticleIDParams{ctx, articleID}
+
+	// Record call args
+	mmDeleteByArticleID.DeleteByArticleIDMock.mutex.Lock()
+	mmDeleteByArticleID.DeleteByArticleIDMock.callArgs = append(mmDeleteByArticleID.DeleteByArticleIDMock.callArgs, mm_params)
+	mmDeleteByArticleID.DeleteByArticleIDMock.mutex.Unlock()
+
+	for _, e := range mmDeleteByArticleID.DeleteByArticleIDMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmDeleteByArticleID.DeleteByArticleIDMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmDeleteByArticleID.DeleteByArticleIDMock.defaultExpectation.Counter, 1)
+		mm_want := mmDeleteByArticleID.DeleteByArticleIDMock.defaultExpectation.params
+		mm_got := IArticleTagRepositoryMockDeleteByArticleIDParams{ctx, articleID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDeleteByArticleID.t.Errorf("IArticleTagRepositoryMock.DeleteByArticleID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmDeleteByArticleID.DeleteByArticleIDMock.defaultExpectation.results
+		if mm_results == nil {
+			mmDeleteByArticleID.t.Fatal("No results are set for the IArticleTagRepositoryMock.DeleteByArticleID")
+		}
+		return (*mm_results).err
+	}
+	if mmDeleteByArticleID.funcDeleteByArticleID != nil {
+		return mmDeleteByArticleID.funcDeleteByArticleID(ctx, articleID)
+	}
+	mmDeleteByArticleID.t.Fatalf("Unexpected call to IArticleTagRepositoryMock.DeleteByArticleID. %v %v", ctx, articleID)
+	return
+}
+
+// DeleteByArticleIDAfterCounter returns a count of finished IArticleTagRepositoryMock.DeleteByArticleID invocations
+func (mmDeleteByArticleID *IArticleTagRepositoryMock) DeleteByArticleIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDeleteByArticleID.afterDeleteByArticleIDCounter)
+}
+
+// DeleteByArticleIDBeforeCounter returns a count of IArticleTagRepositoryMock.DeleteByArticleID invocations
+func (mmDeleteByArticleID *IArticleTagRepositoryMock) DeleteByArticleIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDeleteByArticleID.beforeDeleteByArticleIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to IArticleTagRepositoryMock.DeleteByArticleID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDeleteByArticleID *mIArticleTagRepositoryMockDeleteByArticleID) Calls() []*IArticleTagRepositoryMockDeleteByArticleIDParams {
+	mmDeleteByArticleID.mutex.RLock()
+
+	argCopy := make([]*IArticleTagRepositoryMockDeleteByArticleIDParams, len(mmDeleteByArticleID.callArgs))
+	copy(argCopy, mmDeleteByArticleID.callArgs)
+
+	mmDeleteByArticleID.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockDeleteByArticleIDDone returns true if the count of the DeleteByArticleID invocations corresponds
+// the number of defined expectations
+func (m *IArticleTagRepositoryMock) MinimockDeleteByArticleIDDone() bool {
+	for _, e := range m.DeleteByArticleIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteByArticleIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteByArticleIDCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDeleteByArticleID != nil && mm_atomic.LoadUint64(&m.afterDeleteByArticleIDCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockDeleteByArticleIDInspect logs each unmet expectation
+func (m *IArticleTagRepositoryMock) MinimockDeleteByArticleIDInspect() {
+	for _, e := range m.DeleteByArticleIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IArticleTagRepositoryMock.DeleteByArticleID with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteByArticleIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteByArticleIDCounter) < 1 {
+		if m.DeleteByArticleIDMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IArticleTagRepositoryMock.DeleteByArticleID")
+		} else {
+			m.t.Errorf("Expected call to IArticleTagRepositoryMock.DeleteByArticleID with params: %#v", *m.DeleteByArticleIDMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDeleteByArticleID != nil && mm_atomic.LoadUint64(&m.afterDeleteByArticleIDCounter) < 1 {
+		m.t.Error("Expected call to IArticleTagRepositoryMock.DeleteByArticleID")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *IArticleTagRepositoryMock) MinimockFinish() {
+	if !m.minimockDone() {
+		m.MinimockAddInspect()
+
+		m.MinimockDeleteInspect()
+
+		m.MinimockDeleteByArticleIDInspect()
+		m.t.FailNow()
+	}
+}
+
+// MinimockWait waits for all mocked methods to be called the expected number of times
+func (m *IArticleTagRepositoryMock) MinimockWait(timeout mm_time.Duration) {
+	timeoutCh := mm_time.After(timeout)
+	for {
+		if m.minimockDone() {
+			return
+		}
+		select {
+		case <-timeoutCh:
+			m.MinimockFinish()
+			return
+		case <-mm_time.After(10 * mm_time.Millisecond):
+		}
+	}
+}
+
+func (m *IArticleTagRepositoryMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockAddDone() &&
+		m.MinimockDeleteDone() &&
+		m.MinimockDeleteByArticleIDDone()
+}

+ 2113 - 0
internal/repositories/mocks/i_tag_repository_minimock.go

@@ -0,0 +1,2113 @@
+package mocks
+
+// Code generated by http://github.com/gojuno/minimock (dev). DO NOT EDIT.
+
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.ITagRepository -o ./mocks/i_tag_repository_minimock.go -n ITagRepositoryMock
+
+import (
+	"context"
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/dmitriygnatenko/internal/models"
+	"github.com/gojuno/minimock/v3"
+)
+
+// ITagRepositoryMock implements interfaces.ITagRepository
+type ITagRepositoryMock struct {
+	t minimock.Tester
+
+	funcAdd          func(ctx context.Context, m models.Tag) (err error)
+	inspectFuncAdd   func(ctx context.Context, m models.Tag)
+	afterAddCounter  uint64
+	beforeAddCounter uint64
+	AddMock          mITagRepositoryMockAdd
+
+	funcDelete          func(ctx context.Context, ID int) (err error)
+	inspectFuncDelete   func(ctx context.Context, ID int)
+	afterDeleteCounter  uint64
+	beforeDeleteCounter uint64
+	DeleteMock          mITagRepositoryMockDelete
+
+	funcGetAll          func(ctx context.Context) (ta1 []models.Tag, err error)
+	inspectFuncGetAll   func(ctx context.Context)
+	afterGetAllCounter  uint64
+	beforeGetAllCounter uint64
+	GetAllMock          mITagRepositoryMockGetAll
+
+	funcGetAllUsed          func(ctx context.Context) (ta1 []models.Tag, err error)
+	inspectFuncGetAllUsed   func(ctx context.Context)
+	afterGetAllUsedCounter  uint64
+	beforeGetAllUsedCounter uint64
+	GetAllUsedMock          mITagRepositoryMockGetAllUsed
+
+	funcGetByArticleID          func(ctx context.Context, ID int) (ta1 []models.Tag, err error)
+	inspectFuncGetByArticleID   func(ctx context.Context, ID int)
+	afterGetByArticleIDCounter  uint64
+	beforeGetByArticleIDCounter uint64
+	GetByArticleIDMock          mITagRepositoryMockGetByArticleID
+
+	funcGetByID          func(ctx context.Context, ID int) (tp1 *models.Tag, err error)
+	inspectFuncGetByID   func(ctx context.Context, ID int)
+	afterGetByIDCounter  uint64
+	beforeGetByIDCounter uint64
+	GetByIDMock          mITagRepositoryMockGetByID
+
+	funcGetByURL          func(ctx context.Context, tag string) (tp1 *models.Tag, err error)
+	inspectFuncGetByURL   func(ctx context.Context, tag string)
+	afterGetByURLCounter  uint64
+	beforeGetByURLCounter uint64
+	GetByURLMock          mITagRepositoryMockGetByURL
+
+	funcIsUsed          func(ctx context.Context, ID int) (b1 bool, err error)
+	inspectFuncIsUsed   func(ctx context.Context, ID int)
+	afterIsUsedCounter  uint64
+	beforeIsUsedCounter uint64
+	IsUsedMock          mITagRepositoryMockIsUsed
+
+	funcUpdate          func(ctx context.Context, m models.Tag) (err error)
+	inspectFuncUpdate   func(ctx context.Context, m models.Tag)
+	afterUpdateCounter  uint64
+	beforeUpdateCounter uint64
+	UpdateMock          mITagRepositoryMockUpdate
+}
+
+// NewITagRepositoryMock returns a mock for interfaces.ITagRepository
+func NewITagRepositoryMock(t minimock.Tester) *ITagRepositoryMock {
+	m := &ITagRepositoryMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.AddMock = mITagRepositoryMockAdd{mock: m}
+	m.AddMock.callArgs = []*ITagRepositoryMockAddParams{}
+
+	m.DeleteMock = mITagRepositoryMockDelete{mock: m}
+	m.DeleteMock.callArgs = []*ITagRepositoryMockDeleteParams{}
+
+	m.GetAllMock = mITagRepositoryMockGetAll{mock: m}
+	m.GetAllMock.callArgs = []*ITagRepositoryMockGetAllParams{}
+
+	m.GetAllUsedMock = mITagRepositoryMockGetAllUsed{mock: m}
+	m.GetAllUsedMock.callArgs = []*ITagRepositoryMockGetAllUsedParams{}
+
+	m.GetByArticleIDMock = mITagRepositoryMockGetByArticleID{mock: m}
+	m.GetByArticleIDMock.callArgs = []*ITagRepositoryMockGetByArticleIDParams{}
+
+	m.GetByIDMock = mITagRepositoryMockGetByID{mock: m}
+	m.GetByIDMock.callArgs = []*ITagRepositoryMockGetByIDParams{}
+
+	m.GetByURLMock = mITagRepositoryMockGetByURL{mock: m}
+	m.GetByURLMock.callArgs = []*ITagRepositoryMockGetByURLParams{}
+
+	m.IsUsedMock = mITagRepositoryMockIsUsed{mock: m}
+	m.IsUsedMock.callArgs = []*ITagRepositoryMockIsUsedParams{}
+
+	m.UpdateMock = mITagRepositoryMockUpdate{mock: m}
+	m.UpdateMock.callArgs = []*ITagRepositoryMockUpdateParams{}
+
+	return m
+}
+
+type mITagRepositoryMockAdd struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockAddExpectation
+	expectations       []*ITagRepositoryMockAddExpectation
+
+	callArgs []*ITagRepositoryMockAddParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockAddExpectation specifies expectation struct of the ITagRepository.Add
+type ITagRepositoryMockAddExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockAddParams
+	results *ITagRepositoryMockAddResults
+	Counter uint64
+}
+
+// ITagRepositoryMockAddParams contains parameters of the ITagRepository.Add
+type ITagRepositoryMockAddParams struct {
+	ctx context.Context
+	m   models.Tag
+}
+
+// ITagRepositoryMockAddResults contains results of the ITagRepository.Add
+type ITagRepositoryMockAddResults struct {
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.Add
+func (mmAdd *mITagRepositoryMockAdd) Expect(ctx context.Context, m models.Tag) *mITagRepositoryMockAdd {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ITagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &ITagRepositoryMockAddExpectation{}
+	}
+
+	mmAdd.defaultExpectation.params = &ITagRepositoryMockAddParams{ctx, m}
+	for _, e := range mmAdd.expectations {
+		if minimock.Equal(e.params, mmAdd.defaultExpectation.params) {
+			mmAdd.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmAdd.defaultExpectation.params)
+		}
+	}
+
+	return mmAdd
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.Add
+func (mmAdd *mITagRepositoryMockAdd) Inspect(f func(ctx context.Context, m models.Tag)) *mITagRepositoryMockAdd {
+	if mmAdd.mock.inspectFuncAdd != nil {
+		mmAdd.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.Add")
+	}
+
+	mmAdd.mock.inspectFuncAdd = f
+
+	return mmAdd
+}
+
+// Return sets up results that will be returned by ITagRepository.Add
+func (mmAdd *mITagRepositoryMockAdd) Return(err error) *ITagRepositoryMock {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ITagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &ITagRepositoryMockAddExpectation{mock: mmAdd.mock}
+	}
+	mmAdd.defaultExpectation.results = &ITagRepositoryMockAddResults{err}
+	return mmAdd.mock
+}
+
+//Set uses given function f to mock the ITagRepository.Add method
+func (mmAdd *mITagRepositoryMockAdd) Set(f func(ctx context.Context, m models.Tag) (err error)) *ITagRepositoryMock {
+	if mmAdd.defaultExpectation != nil {
+		mmAdd.mock.t.Fatalf("Default expectation is already set for the ITagRepository.Add method")
+	}
+
+	if len(mmAdd.expectations) > 0 {
+		mmAdd.mock.t.Fatalf("Some expectations are already set for the ITagRepository.Add method")
+	}
+
+	mmAdd.mock.funcAdd = f
+	return mmAdd.mock
+}
+
+// When sets expectation for the ITagRepository.Add which will trigger the result defined by the following
+// Then helper
+func (mmAdd *mITagRepositoryMockAdd) When(ctx context.Context, m models.Tag) *ITagRepositoryMockAddExpectation {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ITagRepositoryMock.Add mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockAddExpectation{
+		mock:   mmAdd.mock,
+		params: &ITagRepositoryMockAddParams{ctx, m},
+	}
+	mmAdd.expectations = append(mmAdd.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.Add return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockAddExpectation) Then(err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockAddResults{err}
+	return e.mock
+}
+
+// Add implements interfaces.ITagRepository
+func (mmAdd *ITagRepositoryMock) Add(ctx context.Context, m models.Tag) (err error) {
+	mm_atomic.AddUint64(&mmAdd.beforeAddCounter, 1)
+	defer mm_atomic.AddUint64(&mmAdd.afterAddCounter, 1)
+
+	if mmAdd.inspectFuncAdd != nil {
+		mmAdd.inspectFuncAdd(ctx, m)
+	}
+
+	mm_params := &ITagRepositoryMockAddParams{ctx, m}
+
+	// Record call args
+	mmAdd.AddMock.mutex.Lock()
+	mmAdd.AddMock.callArgs = append(mmAdd.AddMock.callArgs, mm_params)
+	mmAdd.AddMock.mutex.Unlock()
+
+	for _, e := range mmAdd.AddMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmAdd.AddMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmAdd.AddMock.defaultExpectation.Counter, 1)
+		mm_want := mmAdd.AddMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockAddParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmAdd.t.Errorf("ITagRepositoryMock.Add got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmAdd.AddMock.defaultExpectation.results
+		if mm_results == nil {
+			mmAdd.t.Fatal("No results are set for the ITagRepositoryMock.Add")
+		}
+		return (*mm_results).err
+	}
+	if mmAdd.funcAdd != nil {
+		return mmAdd.funcAdd(ctx, m)
+	}
+	mmAdd.t.Fatalf("Unexpected call to ITagRepositoryMock.Add. %v %v", ctx, m)
+	return
+}
+
+// AddAfterCounter returns a count of finished ITagRepositoryMock.Add invocations
+func (mmAdd *ITagRepositoryMock) AddAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.afterAddCounter)
+}
+
+// AddBeforeCounter returns a count of ITagRepositoryMock.Add invocations
+func (mmAdd *ITagRepositoryMock) AddBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.beforeAddCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.Add.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmAdd *mITagRepositoryMockAdd) Calls() []*ITagRepositoryMockAddParams {
+	mmAdd.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockAddParams, len(mmAdd.callArgs))
+	copy(argCopy, mmAdd.callArgs)
+
+	mmAdd.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockAddDone returns true if the count of the Add invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockAddDone() bool {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.AddMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcAdd != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockAddInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockAddInspect() {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.Add with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.AddMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		if m.AddMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.Add")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.Add with params: %#v", *m.AddMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcAdd != nil && mm_atomic.LoadUint64(&m.afterAddCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.Add")
+	}
+}
+
+type mITagRepositoryMockDelete struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockDeleteExpectation
+	expectations       []*ITagRepositoryMockDeleteExpectation
+
+	callArgs []*ITagRepositoryMockDeleteParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockDeleteExpectation specifies expectation struct of the ITagRepository.Delete
+type ITagRepositoryMockDeleteExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockDeleteParams
+	results *ITagRepositoryMockDeleteResults
+	Counter uint64
+}
+
+// ITagRepositoryMockDeleteParams contains parameters of the ITagRepository.Delete
+type ITagRepositoryMockDeleteParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// ITagRepositoryMockDeleteResults contains results of the ITagRepository.Delete
+type ITagRepositoryMockDeleteResults struct {
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.Delete
+func (mmDelete *mITagRepositoryMockDelete) Expect(ctx context.Context, ID int) *mITagRepositoryMockDelete {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ITagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &ITagRepositoryMockDeleteExpectation{}
+	}
+
+	mmDelete.defaultExpectation.params = &ITagRepositoryMockDeleteParams{ctx, ID}
+	for _, e := range mmDelete.expectations {
+		if minimock.Equal(e.params, mmDelete.defaultExpectation.params) {
+			mmDelete.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDelete.defaultExpectation.params)
+		}
+	}
+
+	return mmDelete
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.Delete
+func (mmDelete *mITagRepositoryMockDelete) Inspect(f func(ctx context.Context, ID int)) *mITagRepositoryMockDelete {
+	if mmDelete.mock.inspectFuncDelete != nil {
+		mmDelete.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.Delete")
+	}
+
+	mmDelete.mock.inspectFuncDelete = f
+
+	return mmDelete
+}
+
+// Return sets up results that will be returned by ITagRepository.Delete
+func (mmDelete *mITagRepositoryMockDelete) Return(err error) *ITagRepositoryMock {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ITagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &ITagRepositoryMockDeleteExpectation{mock: mmDelete.mock}
+	}
+	mmDelete.defaultExpectation.results = &ITagRepositoryMockDeleteResults{err}
+	return mmDelete.mock
+}
+
+//Set uses given function f to mock the ITagRepository.Delete method
+func (mmDelete *mITagRepositoryMockDelete) Set(f func(ctx context.Context, ID int) (err error)) *ITagRepositoryMock {
+	if mmDelete.defaultExpectation != nil {
+		mmDelete.mock.t.Fatalf("Default expectation is already set for the ITagRepository.Delete method")
+	}
+
+	if len(mmDelete.expectations) > 0 {
+		mmDelete.mock.t.Fatalf("Some expectations are already set for the ITagRepository.Delete method")
+	}
+
+	mmDelete.mock.funcDelete = f
+	return mmDelete.mock
+}
+
+// When sets expectation for the ITagRepository.Delete which will trigger the result defined by the following
+// Then helper
+func (mmDelete *mITagRepositoryMockDelete) When(ctx context.Context, ID int) *ITagRepositoryMockDeleteExpectation {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ITagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockDeleteExpectation{
+		mock:   mmDelete.mock,
+		params: &ITagRepositoryMockDeleteParams{ctx, ID},
+	}
+	mmDelete.expectations = append(mmDelete.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.Delete return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockDeleteExpectation) Then(err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockDeleteResults{err}
+	return e.mock
+}
+
+// Delete implements interfaces.ITagRepository
+func (mmDelete *ITagRepositoryMock) Delete(ctx context.Context, ID int) (err error) {
+	mm_atomic.AddUint64(&mmDelete.beforeDeleteCounter, 1)
+	defer mm_atomic.AddUint64(&mmDelete.afterDeleteCounter, 1)
+
+	if mmDelete.inspectFuncDelete != nil {
+		mmDelete.inspectFuncDelete(ctx, ID)
+	}
+
+	mm_params := &ITagRepositoryMockDeleteParams{ctx, ID}
+
+	// Record call args
+	mmDelete.DeleteMock.mutex.Lock()
+	mmDelete.DeleteMock.callArgs = append(mmDelete.DeleteMock.callArgs, mm_params)
+	mmDelete.DeleteMock.mutex.Unlock()
+
+	for _, e := range mmDelete.DeleteMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmDelete.DeleteMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmDelete.DeleteMock.defaultExpectation.Counter, 1)
+		mm_want := mmDelete.DeleteMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockDeleteParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDelete.t.Errorf("ITagRepositoryMock.Delete got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmDelete.DeleteMock.defaultExpectation.results
+		if mm_results == nil {
+			mmDelete.t.Fatal("No results are set for the ITagRepositoryMock.Delete")
+		}
+		return (*mm_results).err
+	}
+	if mmDelete.funcDelete != nil {
+		return mmDelete.funcDelete(ctx, ID)
+	}
+	mmDelete.t.Fatalf("Unexpected call to ITagRepositoryMock.Delete. %v %v", ctx, ID)
+	return
+}
+
+// DeleteAfterCounter returns a count of finished ITagRepositoryMock.Delete invocations
+func (mmDelete *ITagRepositoryMock) DeleteAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.afterDeleteCounter)
+}
+
+// DeleteBeforeCounter returns a count of ITagRepositoryMock.Delete invocations
+func (mmDelete *ITagRepositoryMock) DeleteBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.beforeDeleteCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.Delete.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDelete *mITagRepositoryMockDelete) Calls() []*ITagRepositoryMockDeleteParams {
+	mmDelete.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockDeleteParams, len(mmDelete.callArgs))
+	copy(argCopy, mmDelete.callArgs)
+
+	mmDelete.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockDeleteDone returns true if the count of the Delete invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockDeleteDone() bool {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDelete != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockDeleteInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockDeleteInspect() {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.Delete with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.DeleteMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		if m.DeleteMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.Delete")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.Delete with params: %#v", *m.DeleteMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcDelete != nil && mm_atomic.LoadUint64(&m.afterDeleteCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.Delete")
+	}
+}
+
+type mITagRepositoryMockGetAll struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockGetAllExpectation
+	expectations       []*ITagRepositoryMockGetAllExpectation
+
+	callArgs []*ITagRepositoryMockGetAllParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockGetAllExpectation specifies expectation struct of the ITagRepository.GetAll
+type ITagRepositoryMockGetAllExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockGetAllParams
+	results *ITagRepositoryMockGetAllResults
+	Counter uint64
+}
+
+// ITagRepositoryMockGetAllParams contains parameters of the ITagRepository.GetAll
+type ITagRepositoryMockGetAllParams struct {
+	ctx context.Context
+}
+
+// ITagRepositoryMockGetAllResults contains results of the ITagRepository.GetAll
+type ITagRepositoryMockGetAllResults struct {
+	ta1 []models.Tag
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.GetAll
+func (mmGetAll *mITagRepositoryMockGetAll) Expect(ctx context.Context) *mITagRepositoryMockGetAll {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("ITagRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &ITagRepositoryMockGetAllExpectation{}
+	}
+
+	mmGetAll.defaultExpectation.params = &ITagRepositoryMockGetAllParams{ctx}
+	for _, e := range mmGetAll.expectations {
+		if minimock.Equal(e.params, mmGetAll.defaultExpectation.params) {
+			mmGetAll.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetAll.defaultExpectation.params)
+		}
+	}
+
+	return mmGetAll
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.GetAll
+func (mmGetAll *mITagRepositoryMockGetAll) Inspect(f func(ctx context.Context)) *mITagRepositoryMockGetAll {
+	if mmGetAll.mock.inspectFuncGetAll != nil {
+		mmGetAll.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.GetAll")
+	}
+
+	mmGetAll.mock.inspectFuncGetAll = f
+
+	return mmGetAll
+}
+
+// Return sets up results that will be returned by ITagRepository.GetAll
+func (mmGetAll *mITagRepositoryMockGetAll) Return(ta1 []models.Tag, err error) *ITagRepositoryMock {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("ITagRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &ITagRepositoryMockGetAllExpectation{mock: mmGetAll.mock}
+	}
+	mmGetAll.defaultExpectation.results = &ITagRepositoryMockGetAllResults{ta1, err}
+	return mmGetAll.mock
+}
+
+//Set uses given function f to mock the ITagRepository.GetAll method
+func (mmGetAll *mITagRepositoryMockGetAll) Set(f func(ctx context.Context) (ta1 []models.Tag, err error)) *ITagRepositoryMock {
+	if mmGetAll.defaultExpectation != nil {
+		mmGetAll.mock.t.Fatalf("Default expectation is already set for the ITagRepository.GetAll method")
+	}
+
+	if len(mmGetAll.expectations) > 0 {
+		mmGetAll.mock.t.Fatalf("Some expectations are already set for the ITagRepository.GetAll method")
+	}
+
+	mmGetAll.mock.funcGetAll = f
+	return mmGetAll.mock
+}
+
+// When sets expectation for the ITagRepository.GetAll which will trigger the result defined by the following
+// Then helper
+func (mmGetAll *mITagRepositoryMockGetAll) When(ctx context.Context) *ITagRepositoryMockGetAllExpectation {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("ITagRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockGetAllExpectation{
+		mock:   mmGetAll.mock,
+		params: &ITagRepositoryMockGetAllParams{ctx},
+	}
+	mmGetAll.expectations = append(mmGetAll.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.GetAll return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockGetAllExpectation) Then(ta1 []models.Tag, err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockGetAllResults{ta1, err}
+	return e.mock
+}
+
+// GetAll implements interfaces.ITagRepository
+func (mmGetAll *ITagRepositoryMock) GetAll(ctx context.Context) (ta1 []models.Tag, err error) {
+	mm_atomic.AddUint64(&mmGetAll.beforeGetAllCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetAll.afterGetAllCounter, 1)
+
+	if mmGetAll.inspectFuncGetAll != nil {
+		mmGetAll.inspectFuncGetAll(ctx)
+	}
+
+	mm_params := &ITagRepositoryMockGetAllParams{ctx}
+
+	// Record call args
+	mmGetAll.GetAllMock.mutex.Lock()
+	mmGetAll.GetAllMock.callArgs = append(mmGetAll.GetAllMock.callArgs, mm_params)
+	mmGetAll.GetAllMock.mutex.Unlock()
+
+	for _, e := range mmGetAll.GetAllMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.ta1, e.results.err
+		}
+	}
+
+	if mmGetAll.GetAllMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetAll.GetAllMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetAll.GetAllMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockGetAllParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAll.t.Errorf("ITagRepositoryMock.GetAll got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetAll.GetAllMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetAll.t.Fatal("No results are set for the ITagRepositoryMock.GetAll")
+		}
+		return (*mm_results).ta1, (*mm_results).err
+	}
+	if mmGetAll.funcGetAll != nil {
+		return mmGetAll.funcGetAll(ctx)
+	}
+	mmGetAll.t.Fatalf("Unexpected call to ITagRepositoryMock.GetAll. %v", ctx)
+	return
+}
+
+// GetAllAfterCounter returns a count of finished ITagRepositoryMock.GetAll invocations
+func (mmGetAll *ITagRepositoryMock) GetAllAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.afterGetAllCounter)
+}
+
+// GetAllBeforeCounter returns a count of ITagRepositoryMock.GetAll invocations
+func (mmGetAll *ITagRepositoryMock) GetAllBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.beforeGetAllCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.GetAll.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAll *mITagRepositoryMockGetAll) Calls() []*ITagRepositoryMockGetAllParams {
+	mmGetAll.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockGetAllParams, len(mmGetAll.callArgs))
+	copy(argCopy, mmGetAll.callArgs)
+
+	mmGetAll.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetAllDone returns true if the count of the GetAll invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockGetAllDone() bool {
+	for _, e := range m.GetAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAll != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetAllInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockGetAllInspect() {
+	for _, e := range m.GetAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetAll with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		if m.GetAllMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.GetAll")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetAll with params: %#v", *m.GetAllMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAll != nil && mm_atomic.LoadUint64(&m.afterGetAllCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.GetAll")
+	}
+}
+
+type mITagRepositoryMockGetAllUsed struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockGetAllUsedExpectation
+	expectations       []*ITagRepositoryMockGetAllUsedExpectation
+
+	callArgs []*ITagRepositoryMockGetAllUsedParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockGetAllUsedExpectation specifies expectation struct of the ITagRepository.GetAllUsed
+type ITagRepositoryMockGetAllUsedExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockGetAllUsedParams
+	results *ITagRepositoryMockGetAllUsedResults
+	Counter uint64
+}
+
+// ITagRepositoryMockGetAllUsedParams contains parameters of the ITagRepository.GetAllUsed
+type ITagRepositoryMockGetAllUsedParams struct {
+	ctx context.Context
+}
+
+// ITagRepositoryMockGetAllUsedResults contains results of the ITagRepository.GetAllUsed
+type ITagRepositoryMockGetAllUsedResults struct {
+	ta1 []models.Tag
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.GetAllUsed
+func (mmGetAllUsed *mITagRepositoryMockGetAllUsed) Expect(ctx context.Context) *mITagRepositoryMockGetAllUsed {
+	if mmGetAllUsed.mock.funcGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("ITagRepositoryMock.GetAllUsed mock is already set by Set")
+	}
+
+	if mmGetAllUsed.defaultExpectation == nil {
+		mmGetAllUsed.defaultExpectation = &ITagRepositoryMockGetAllUsedExpectation{}
+	}
+
+	mmGetAllUsed.defaultExpectation.params = &ITagRepositoryMockGetAllUsedParams{ctx}
+	for _, e := range mmGetAllUsed.expectations {
+		if minimock.Equal(e.params, mmGetAllUsed.defaultExpectation.params) {
+			mmGetAllUsed.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetAllUsed.defaultExpectation.params)
+		}
+	}
+
+	return mmGetAllUsed
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.GetAllUsed
+func (mmGetAllUsed *mITagRepositoryMockGetAllUsed) Inspect(f func(ctx context.Context)) *mITagRepositoryMockGetAllUsed {
+	if mmGetAllUsed.mock.inspectFuncGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.GetAllUsed")
+	}
+
+	mmGetAllUsed.mock.inspectFuncGetAllUsed = f
+
+	return mmGetAllUsed
+}
+
+// Return sets up results that will be returned by ITagRepository.GetAllUsed
+func (mmGetAllUsed *mITagRepositoryMockGetAllUsed) Return(ta1 []models.Tag, err error) *ITagRepositoryMock {
+	if mmGetAllUsed.mock.funcGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("ITagRepositoryMock.GetAllUsed mock is already set by Set")
+	}
+
+	if mmGetAllUsed.defaultExpectation == nil {
+		mmGetAllUsed.defaultExpectation = &ITagRepositoryMockGetAllUsedExpectation{mock: mmGetAllUsed.mock}
+	}
+	mmGetAllUsed.defaultExpectation.results = &ITagRepositoryMockGetAllUsedResults{ta1, err}
+	return mmGetAllUsed.mock
+}
+
+//Set uses given function f to mock the ITagRepository.GetAllUsed method
+func (mmGetAllUsed *mITagRepositoryMockGetAllUsed) Set(f func(ctx context.Context) (ta1 []models.Tag, err error)) *ITagRepositoryMock {
+	if mmGetAllUsed.defaultExpectation != nil {
+		mmGetAllUsed.mock.t.Fatalf("Default expectation is already set for the ITagRepository.GetAllUsed method")
+	}
+
+	if len(mmGetAllUsed.expectations) > 0 {
+		mmGetAllUsed.mock.t.Fatalf("Some expectations are already set for the ITagRepository.GetAllUsed method")
+	}
+
+	mmGetAllUsed.mock.funcGetAllUsed = f
+	return mmGetAllUsed.mock
+}
+
+// When sets expectation for the ITagRepository.GetAllUsed which will trigger the result defined by the following
+// Then helper
+func (mmGetAllUsed *mITagRepositoryMockGetAllUsed) When(ctx context.Context) *ITagRepositoryMockGetAllUsedExpectation {
+	if mmGetAllUsed.mock.funcGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("ITagRepositoryMock.GetAllUsed mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockGetAllUsedExpectation{
+		mock:   mmGetAllUsed.mock,
+		params: &ITagRepositoryMockGetAllUsedParams{ctx},
+	}
+	mmGetAllUsed.expectations = append(mmGetAllUsed.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.GetAllUsed return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockGetAllUsedExpectation) Then(ta1 []models.Tag, err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockGetAllUsedResults{ta1, err}
+	return e.mock
+}
+
+// GetAllUsed implements interfaces.ITagRepository
+func (mmGetAllUsed *ITagRepositoryMock) GetAllUsed(ctx context.Context) (ta1 []models.Tag, err error) {
+	mm_atomic.AddUint64(&mmGetAllUsed.beforeGetAllUsedCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetAllUsed.afterGetAllUsedCounter, 1)
+
+	if mmGetAllUsed.inspectFuncGetAllUsed != nil {
+		mmGetAllUsed.inspectFuncGetAllUsed(ctx)
+	}
+
+	mm_params := &ITagRepositoryMockGetAllUsedParams{ctx}
+
+	// Record call args
+	mmGetAllUsed.GetAllUsedMock.mutex.Lock()
+	mmGetAllUsed.GetAllUsedMock.callArgs = append(mmGetAllUsed.GetAllUsedMock.callArgs, mm_params)
+	mmGetAllUsed.GetAllUsedMock.mutex.Unlock()
+
+	for _, e := range mmGetAllUsed.GetAllUsedMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.ta1, e.results.err
+		}
+	}
+
+	if mmGetAllUsed.GetAllUsedMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetAllUsed.GetAllUsedMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetAllUsed.GetAllUsedMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockGetAllUsedParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAllUsed.t.Errorf("ITagRepositoryMock.GetAllUsed got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetAllUsed.GetAllUsedMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetAllUsed.t.Fatal("No results are set for the ITagRepositoryMock.GetAllUsed")
+		}
+		return (*mm_results).ta1, (*mm_results).err
+	}
+	if mmGetAllUsed.funcGetAllUsed != nil {
+		return mmGetAllUsed.funcGetAllUsed(ctx)
+	}
+	mmGetAllUsed.t.Fatalf("Unexpected call to ITagRepositoryMock.GetAllUsed. %v", ctx)
+	return
+}
+
+// GetAllUsedAfterCounter returns a count of finished ITagRepositoryMock.GetAllUsed invocations
+func (mmGetAllUsed *ITagRepositoryMock) GetAllUsedAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllUsed.afterGetAllUsedCounter)
+}
+
+// GetAllUsedBeforeCounter returns a count of ITagRepositoryMock.GetAllUsed invocations
+func (mmGetAllUsed *ITagRepositoryMock) GetAllUsedBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllUsed.beforeGetAllUsedCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.GetAllUsed.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAllUsed *mITagRepositoryMockGetAllUsed) Calls() []*ITagRepositoryMockGetAllUsedParams {
+	mmGetAllUsed.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockGetAllUsedParams, len(mmGetAllUsed.callArgs))
+	copy(argCopy, mmGetAllUsed.callArgs)
+
+	mmGetAllUsed.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetAllUsedDone returns true if the count of the GetAllUsed invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockGetAllUsedDone() bool {
+	for _, e := range m.GetAllUsedMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllUsedMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllUsedCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAllUsed != nil && mm_atomic.LoadUint64(&m.afterGetAllUsedCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetAllUsedInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockGetAllUsedInspect() {
+	for _, e := range m.GetAllUsedMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetAllUsed with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetAllUsedMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetAllUsedCounter) < 1 {
+		if m.GetAllUsedMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.GetAllUsed")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetAllUsed with params: %#v", *m.GetAllUsedMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetAllUsed != nil && mm_atomic.LoadUint64(&m.afterGetAllUsedCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.GetAllUsed")
+	}
+}
+
+type mITagRepositoryMockGetByArticleID struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockGetByArticleIDExpectation
+	expectations       []*ITagRepositoryMockGetByArticleIDExpectation
+
+	callArgs []*ITagRepositoryMockGetByArticleIDParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockGetByArticleIDExpectation specifies expectation struct of the ITagRepository.GetByArticleID
+type ITagRepositoryMockGetByArticleIDExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockGetByArticleIDParams
+	results *ITagRepositoryMockGetByArticleIDResults
+	Counter uint64
+}
+
+// ITagRepositoryMockGetByArticleIDParams contains parameters of the ITagRepository.GetByArticleID
+type ITagRepositoryMockGetByArticleIDParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// ITagRepositoryMockGetByArticleIDResults contains results of the ITagRepository.GetByArticleID
+type ITagRepositoryMockGetByArticleIDResults struct {
+	ta1 []models.Tag
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.GetByArticleID
+func (mmGetByArticleID *mITagRepositoryMockGetByArticleID) Expect(ctx context.Context, ID int) *mITagRepositoryMockGetByArticleID {
+	if mmGetByArticleID.mock.funcGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("ITagRepositoryMock.GetByArticleID mock is already set by Set")
+	}
+
+	if mmGetByArticleID.defaultExpectation == nil {
+		mmGetByArticleID.defaultExpectation = &ITagRepositoryMockGetByArticleIDExpectation{}
+	}
+
+	mmGetByArticleID.defaultExpectation.params = &ITagRepositoryMockGetByArticleIDParams{ctx, ID}
+	for _, e := range mmGetByArticleID.expectations {
+		if minimock.Equal(e.params, mmGetByArticleID.defaultExpectation.params) {
+			mmGetByArticleID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetByArticleID.defaultExpectation.params)
+		}
+	}
+
+	return mmGetByArticleID
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.GetByArticleID
+func (mmGetByArticleID *mITagRepositoryMockGetByArticleID) Inspect(f func(ctx context.Context, ID int)) *mITagRepositoryMockGetByArticleID {
+	if mmGetByArticleID.mock.inspectFuncGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.GetByArticleID")
+	}
+
+	mmGetByArticleID.mock.inspectFuncGetByArticleID = f
+
+	return mmGetByArticleID
+}
+
+// Return sets up results that will be returned by ITagRepository.GetByArticleID
+func (mmGetByArticleID *mITagRepositoryMockGetByArticleID) Return(ta1 []models.Tag, err error) *ITagRepositoryMock {
+	if mmGetByArticleID.mock.funcGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("ITagRepositoryMock.GetByArticleID mock is already set by Set")
+	}
+
+	if mmGetByArticleID.defaultExpectation == nil {
+		mmGetByArticleID.defaultExpectation = &ITagRepositoryMockGetByArticleIDExpectation{mock: mmGetByArticleID.mock}
+	}
+	mmGetByArticleID.defaultExpectation.results = &ITagRepositoryMockGetByArticleIDResults{ta1, err}
+	return mmGetByArticleID.mock
+}
+
+//Set uses given function f to mock the ITagRepository.GetByArticleID method
+func (mmGetByArticleID *mITagRepositoryMockGetByArticleID) Set(f func(ctx context.Context, ID int) (ta1 []models.Tag, err error)) *ITagRepositoryMock {
+	if mmGetByArticleID.defaultExpectation != nil {
+		mmGetByArticleID.mock.t.Fatalf("Default expectation is already set for the ITagRepository.GetByArticleID method")
+	}
+
+	if len(mmGetByArticleID.expectations) > 0 {
+		mmGetByArticleID.mock.t.Fatalf("Some expectations are already set for the ITagRepository.GetByArticleID method")
+	}
+
+	mmGetByArticleID.mock.funcGetByArticleID = f
+	return mmGetByArticleID.mock
+}
+
+// When sets expectation for the ITagRepository.GetByArticleID which will trigger the result defined by the following
+// Then helper
+func (mmGetByArticleID *mITagRepositoryMockGetByArticleID) When(ctx context.Context, ID int) *ITagRepositoryMockGetByArticleIDExpectation {
+	if mmGetByArticleID.mock.funcGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("ITagRepositoryMock.GetByArticleID mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockGetByArticleIDExpectation{
+		mock:   mmGetByArticleID.mock,
+		params: &ITagRepositoryMockGetByArticleIDParams{ctx, ID},
+	}
+	mmGetByArticleID.expectations = append(mmGetByArticleID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.GetByArticleID return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockGetByArticleIDExpectation) Then(ta1 []models.Tag, err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockGetByArticleIDResults{ta1, err}
+	return e.mock
+}
+
+// GetByArticleID implements interfaces.ITagRepository
+func (mmGetByArticleID *ITagRepositoryMock) GetByArticleID(ctx context.Context, ID int) (ta1 []models.Tag, err error) {
+	mm_atomic.AddUint64(&mmGetByArticleID.beforeGetByArticleIDCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetByArticleID.afterGetByArticleIDCounter, 1)
+
+	if mmGetByArticleID.inspectFuncGetByArticleID != nil {
+		mmGetByArticleID.inspectFuncGetByArticleID(ctx, ID)
+	}
+
+	mm_params := &ITagRepositoryMockGetByArticleIDParams{ctx, ID}
+
+	// Record call args
+	mmGetByArticleID.GetByArticleIDMock.mutex.Lock()
+	mmGetByArticleID.GetByArticleIDMock.callArgs = append(mmGetByArticleID.GetByArticleIDMock.callArgs, mm_params)
+	mmGetByArticleID.GetByArticleIDMock.mutex.Unlock()
+
+	for _, e := range mmGetByArticleID.GetByArticleIDMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.ta1, e.results.err
+		}
+	}
+
+	if mmGetByArticleID.GetByArticleIDMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetByArticleID.GetByArticleIDMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetByArticleID.GetByArticleIDMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockGetByArticleIDParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByArticleID.t.Errorf("ITagRepositoryMock.GetByArticleID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetByArticleID.GetByArticleIDMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetByArticleID.t.Fatal("No results are set for the ITagRepositoryMock.GetByArticleID")
+		}
+		return (*mm_results).ta1, (*mm_results).err
+	}
+	if mmGetByArticleID.funcGetByArticleID != nil {
+		return mmGetByArticleID.funcGetByArticleID(ctx, ID)
+	}
+	mmGetByArticleID.t.Fatalf("Unexpected call to ITagRepositoryMock.GetByArticleID. %v %v", ctx, ID)
+	return
+}
+
+// GetByArticleIDAfterCounter returns a count of finished ITagRepositoryMock.GetByArticleID invocations
+func (mmGetByArticleID *ITagRepositoryMock) GetByArticleIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByArticleID.afterGetByArticleIDCounter)
+}
+
+// GetByArticleIDBeforeCounter returns a count of ITagRepositoryMock.GetByArticleID invocations
+func (mmGetByArticleID *ITagRepositoryMock) GetByArticleIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByArticleID.beforeGetByArticleIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.GetByArticleID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByArticleID *mITagRepositoryMockGetByArticleID) Calls() []*ITagRepositoryMockGetByArticleIDParams {
+	mmGetByArticleID.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockGetByArticleIDParams, len(mmGetByArticleID.callArgs))
+	copy(argCopy, mmGetByArticleID.callArgs)
+
+	mmGetByArticleID.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetByArticleIDDone returns true if the count of the GetByArticleID invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockGetByArticleIDDone() bool {
+	for _, e := range m.GetByArticleIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByArticleIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByArticleIDCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByArticleID != nil && mm_atomic.LoadUint64(&m.afterGetByArticleIDCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetByArticleIDInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockGetByArticleIDInspect() {
+	for _, e := range m.GetByArticleIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetByArticleID with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByArticleIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByArticleIDCounter) < 1 {
+		if m.GetByArticleIDMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.GetByArticleID")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetByArticleID with params: %#v", *m.GetByArticleIDMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByArticleID != nil && mm_atomic.LoadUint64(&m.afterGetByArticleIDCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.GetByArticleID")
+	}
+}
+
+type mITagRepositoryMockGetByID struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockGetByIDExpectation
+	expectations       []*ITagRepositoryMockGetByIDExpectation
+
+	callArgs []*ITagRepositoryMockGetByIDParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockGetByIDExpectation specifies expectation struct of the ITagRepository.GetByID
+type ITagRepositoryMockGetByIDExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockGetByIDParams
+	results *ITagRepositoryMockGetByIDResults
+	Counter uint64
+}
+
+// ITagRepositoryMockGetByIDParams contains parameters of the ITagRepository.GetByID
+type ITagRepositoryMockGetByIDParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// ITagRepositoryMockGetByIDResults contains results of the ITagRepository.GetByID
+type ITagRepositoryMockGetByIDResults struct {
+	tp1 *models.Tag
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.GetByID
+func (mmGetByID *mITagRepositoryMockGetByID) Expect(ctx context.Context, ID int) *mITagRepositoryMockGetByID {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("ITagRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &ITagRepositoryMockGetByIDExpectation{}
+	}
+
+	mmGetByID.defaultExpectation.params = &ITagRepositoryMockGetByIDParams{ctx, ID}
+	for _, e := range mmGetByID.expectations {
+		if minimock.Equal(e.params, mmGetByID.defaultExpectation.params) {
+			mmGetByID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetByID.defaultExpectation.params)
+		}
+	}
+
+	return mmGetByID
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.GetByID
+func (mmGetByID *mITagRepositoryMockGetByID) Inspect(f func(ctx context.Context, ID int)) *mITagRepositoryMockGetByID {
+	if mmGetByID.mock.inspectFuncGetByID != nil {
+		mmGetByID.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.GetByID")
+	}
+
+	mmGetByID.mock.inspectFuncGetByID = f
+
+	return mmGetByID
+}
+
+// Return sets up results that will be returned by ITagRepository.GetByID
+func (mmGetByID *mITagRepositoryMockGetByID) Return(tp1 *models.Tag, err error) *ITagRepositoryMock {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("ITagRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &ITagRepositoryMockGetByIDExpectation{mock: mmGetByID.mock}
+	}
+	mmGetByID.defaultExpectation.results = &ITagRepositoryMockGetByIDResults{tp1, err}
+	return mmGetByID.mock
+}
+
+//Set uses given function f to mock the ITagRepository.GetByID method
+func (mmGetByID *mITagRepositoryMockGetByID) Set(f func(ctx context.Context, ID int) (tp1 *models.Tag, err error)) *ITagRepositoryMock {
+	if mmGetByID.defaultExpectation != nil {
+		mmGetByID.mock.t.Fatalf("Default expectation is already set for the ITagRepository.GetByID method")
+	}
+
+	if len(mmGetByID.expectations) > 0 {
+		mmGetByID.mock.t.Fatalf("Some expectations are already set for the ITagRepository.GetByID method")
+	}
+
+	mmGetByID.mock.funcGetByID = f
+	return mmGetByID.mock
+}
+
+// When sets expectation for the ITagRepository.GetByID which will trigger the result defined by the following
+// Then helper
+func (mmGetByID *mITagRepositoryMockGetByID) When(ctx context.Context, ID int) *ITagRepositoryMockGetByIDExpectation {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("ITagRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockGetByIDExpectation{
+		mock:   mmGetByID.mock,
+		params: &ITagRepositoryMockGetByIDParams{ctx, ID},
+	}
+	mmGetByID.expectations = append(mmGetByID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.GetByID return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockGetByIDExpectation) Then(tp1 *models.Tag, err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockGetByIDResults{tp1, err}
+	return e.mock
+}
+
+// GetByID implements interfaces.ITagRepository
+func (mmGetByID *ITagRepositoryMock) GetByID(ctx context.Context, ID int) (tp1 *models.Tag, err error) {
+	mm_atomic.AddUint64(&mmGetByID.beforeGetByIDCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetByID.afterGetByIDCounter, 1)
+
+	if mmGetByID.inspectFuncGetByID != nil {
+		mmGetByID.inspectFuncGetByID(ctx, ID)
+	}
+
+	mm_params := &ITagRepositoryMockGetByIDParams{ctx, ID}
+
+	// Record call args
+	mmGetByID.GetByIDMock.mutex.Lock()
+	mmGetByID.GetByIDMock.callArgs = append(mmGetByID.GetByIDMock.callArgs, mm_params)
+	mmGetByID.GetByIDMock.mutex.Unlock()
+
+	for _, e := range mmGetByID.GetByIDMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.tp1, e.results.err
+		}
+	}
+
+	if mmGetByID.GetByIDMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetByID.GetByIDMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetByID.GetByIDMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockGetByIDParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByID.t.Errorf("ITagRepositoryMock.GetByID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetByID.GetByIDMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetByID.t.Fatal("No results are set for the ITagRepositoryMock.GetByID")
+		}
+		return (*mm_results).tp1, (*mm_results).err
+	}
+	if mmGetByID.funcGetByID != nil {
+		return mmGetByID.funcGetByID(ctx, ID)
+	}
+	mmGetByID.t.Fatalf("Unexpected call to ITagRepositoryMock.GetByID. %v %v", ctx, ID)
+	return
+}
+
+// GetByIDAfterCounter returns a count of finished ITagRepositoryMock.GetByID invocations
+func (mmGetByID *ITagRepositoryMock) GetByIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.afterGetByIDCounter)
+}
+
+// GetByIDBeforeCounter returns a count of ITagRepositoryMock.GetByID invocations
+func (mmGetByID *ITagRepositoryMock) GetByIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.beforeGetByIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.GetByID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByID *mITagRepositoryMockGetByID) Calls() []*ITagRepositoryMockGetByIDParams {
+	mmGetByID.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockGetByIDParams, len(mmGetByID.callArgs))
+	copy(argCopy, mmGetByID.callArgs)
+
+	mmGetByID.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetByIDDone returns true if the count of the GetByID invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockGetByIDDone() bool {
+	for _, e := range m.GetByIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByID != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetByIDInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockGetByIDInspect() {
+	for _, e := range m.GetByIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetByID with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByIDMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		if m.GetByIDMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.GetByID")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetByID with params: %#v", *m.GetByIDMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByID != nil && mm_atomic.LoadUint64(&m.afterGetByIDCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.GetByID")
+	}
+}
+
+type mITagRepositoryMockGetByURL struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockGetByURLExpectation
+	expectations       []*ITagRepositoryMockGetByURLExpectation
+
+	callArgs []*ITagRepositoryMockGetByURLParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockGetByURLExpectation specifies expectation struct of the ITagRepository.GetByURL
+type ITagRepositoryMockGetByURLExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockGetByURLParams
+	results *ITagRepositoryMockGetByURLResults
+	Counter uint64
+}
+
+// ITagRepositoryMockGetByURLParams contains parameters of the ITagRepository.GetByURL
+type ITagRepositoryMockGetByURLParams struct {
+	ctx context.Context
+	tag string
+}
+
+// ITagRepositoryMockGetByURLResults contains results of the ITagRepository.GetByURL
+type ITagRepositoryMockGetByURLResults struct {
+	tp1 *models.Tag
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.GetByURL
+func (mmGetByURL *mITagRepositoryMockGetByURL) Expect(ctx context.Context, tag string) *mITagRepositoryMockGetByURL {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("ITagRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &ITagRepositoryMockGetByURLExpectation{}
+	}
+
+	mmGetByURL.defaultExpectation.params = &ITagRepositoryMockGetByURLParams{ctx, tag}
+	for _, e := range mmGetByURL.expectations {
+		if minimock.Equal(e.params, mmGetByURL.defaultExpectation.params) {
+			mmGetByURL.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetByURL.defaultExpectation.params)
+		}
+	}
+
+	return mmGetByURL
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.GetByURL
+func (mmGetByURL *mITagRepositoryMockGetByURL) Inspect(f func(ctx context.Context, tag string)) *mITagRepositoryMockGetByURL {
+	if mmGetByURL.mock.inspectFuncGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.GetByURL")
+	}
+
+	mmGetByURL.mock.inspectFuncGetByURL = f
+
+	return mmGetByURL
+}
+
+// Return sets up results that will be returned by ITagRepository.GetByURL
+func (mmGetByURL *mITagRepositoryMockGetByURL) Return(tp1 *models.Tag, err error) *ITagRepositoryMock {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("ITagRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &ITagRepositoryMockGetByURLExpectation{mock: mmGetByURL.mock}
+	}
+	mmGetByURL.defaultExpectation.results = &ITagRepositoryMockGetByURLResults{tp1, err}
+	return mmGetByURL.mock
+}
+
+//Set uses given function f to mock the ITagRepository.GetByURL method
+func (mmGetByURL *mITagRepositoryMockGetByURL) Set(f func(ctx context.Context, tag string) (tp1 *models.Tag, err error)) *ITagRepositoryMock {
+	if mmGetByURL.defaultExpectation != nil {
+		mmGetByURL.mock.t.Fatalf("Default expectation is already set for the ITagRepository.GetByURL method")
+	}
+
+	if len(mmGetByURL.expectations) > 0 {
+		mmGetByURL.mock.t.Fatalf("Some expectations are already set for the ITagRepository.GetByURL method")
+	}
+
+	mmGetByURL.mock.funcGetByURL = f
+	return mmGetByURL.mock
+}
+
+// When sets expectation for the ITagRepository.GetByURL which will trigger the result defined by the following
+// Then helper
+func (mmGetByURL *mITagRepositoryMockGetByURL) When(ctx context.Context, tag string) *ITagRepositoryMockGetByURLExpectation {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("ITagRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockGetByURLExpectation{
+		mock:   mmGetByURL.mock,
+		params: &ITagRepositoryMockGetByURLParams{ctx, tag},
+	}
+	mmGetByURL.expectations = append(mmGetByURL.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.GetByURL return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockGetByURLExpectation) Then(tp1 *models.Tag, err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockGetByURLResults{tp1, err}
+	return e.mock
+}
+
+// GetByURL implements interfaces.ITagRepository
+func (mmGetByURL *ITagRepositoryMock) GetByURL(ctx context.Context, tag string) (tp1 *models.Tag, err error) {
+	mm_atomic.AddUint64(&mmGetByURL.beforeGetByURLCounter, 1)
+	defer mm_atomic.AddUint64(&mmGetByURL.afterGetByURLCounter, 1)
+
+	if mmGetByURL.inspectFuncGetByURL != nil {
+		mmGetByURL.inspectFuncGetByURL(ctx, tag)
+	}
+
+	mm_params := &ITagRepositoryMockGetByURLParams{ctx, tag}
+
+	// Record call args
+	mmGetByURL.GetByURLMock.mutex.Lock()
+	mmGetByURL.GetByURLMock.callArgs = append(mmGetByURL.GetByURLMock.callArgs, mm_params)
+	mmGetByURL.GetByURLMock.mutex.Unlock()
+
+	for _, e := range mmGetByURL.GetByURLMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.tp1, e.results.err
+		}
+	}
+
+	if mmGetByURL.GetByURLMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGetByURL.GetByURLMock.defaultExpectation.Counter, 1)
+		mm_want := mmGetByURL.GetByURLMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockGetByURLParams{ctx, tag}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByURL.t.Errorf("ITagRepositoryMock.GetByURL got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGetByURL.GetByURLMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGetByURL.t.Fatal("No results are set for the ITagRepositoryMock.GetByURL")
+		}
+		return (*mm_results).tp1, (*mm_results).err
+	}
+	if mmGetByURL.funcGetByURL != nil {
+		return mmGetByURL.funcGetByURL(ctx, tag)
+	}
+	mmGetByURL.t.Fatalf("Unexpected call to ITagRepositoryMock.GetByURL. %v %v", ctx, tag)
+	return
+}
+
+// GetByURLAfterCounter returns a count of finished ITagRepositoryMock.GetByURL invocations
+func (mmGetByURL *ITagRepositoryMock) GetByURLAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.afterGetByURLCounter)
+}
+
+// GetByURLBeforeCounter returns a count of ITagRepositoryMock.GetByURL invocations
+func (mmGetByURL *ITagRepositoryMock) GetByURLBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.beforeGetByURLCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.GetByURL.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByURL *mITagRepositoryMockGetByURL) Calls() []*ITagRepositoryMockGetByURLParams {
+	mmGetByURL.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockGetByURLParams, len(mmGetByURL.callArgs))
+	copy(argCopy, mmGetByURL.callArgs)
+
+	mmGetByURL.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetByURLDone returns true if the count of the GetByURL invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockGetByURLDone() bool {
+	for _, e := range m.GetByURLMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByURLMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByURL != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetByURLInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockGetByURLInspect() {
+	for _, e := range m.GetByURLMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetByURL with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetByURLMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		if m.GetByURLMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.GetByURL")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.GetByURL with params: %#v", *m.GetByURLMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGetByURL != nil && mm_atomic.LoadUint64(&m.afterGetByURLCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.GetByURL")
+	}
+}
+
+type mITagRepositoryMockIsUsed struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockIsUsedExpectation
+	expectations       []*ITagRepositoryMockIsUsedExpectation
+
+	callArgs []*ITagRepositoryMockIsUsedParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockIsUsedExpectation specifies expectation struct of the ITagRepository.IsUsed
+type ITagRepositoryMockIsUsedExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockIsUsedParams
+	results *ITagRepositoryMockIsUsedResults
+	Counter uint64
+}
+
+// ITagRepositoryMockIsUsedParams contains parameters of the ITagRepository.IsUsed
+type ITagRepositoryMockIsUsedParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// ITagRepositoryMockIsUsedResults contains results of the ITagRepository.IsUsed
+type ITagRepositoryMockIsUsedResults struct {
+	b1  bool
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.IsUsed
+func (mmIsUsed *mITagRepositoryMockIsUsed) Expect(ctx context.Context, ID int) *mITagRepositoryMockIsUsed {
+	if mmIsUsed.mock.funcIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("ITagRepositoryMock.IsUsed mock is already set by Set")
+	}
+
+	if mmIsUsed.defaultExpectation == nil {
+		mmIsUsed.defaultExpectation = &ITagRepositoryMockIsUsedExpectation{}
+	}
+
+	mmIsUsed.defaultExpectation.params = &ITagRepositoryMockIsUsedParams{ctx, ID}
+	for _, e := range mmIsUsed.expectations {
+		if minimock.Equal(e.params, mmIsUsed.defaultExpectation.params) {
+			mmIsUsed.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmIsUsed.defaultExpectation.params)
+		}
+	}
+
+	return mmIsUsed
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.IsUsed
+func (mmIsUsed *mITagRepositoryMockIsUsed) Inspect(f func(ctx context.Context, ID int)) *mITagRepositoryMockIsUsed {
+	if mmIsUsed.mock.inspectFuncIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.IsUsed")
+	}
+
+	mmIsUsed.mock.inspectFuncIsUsed = f
+
+	return mmIsUsed
+}
+
+// Return sets up results that will be returned by ITagRepository.IsUsed
+func (mmIsUsed *mITagRepositoryMockIsUsed) Return(b1 bool, err error) *ITagRepositoryMock {
+	if mmIsUsed.mock.funcIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("ITagRepositoryMock.IsUsed mock is already set by Set")
+	}
+
+	if mmIsUsed.defaultExpectation == nil {
+		mmIsUsed.defaultExpectation = &ITagRepositoryMockIsUsedExpectation{mock: mmIsUsed.mock}
+	}
+	mmIsUsed.defaultExpectation.results = &ITagRepositoryMockIsUsedResults{b1, err}
+	return mmIsUsed.mock
+}
+
+//Set uses given function f to mock the ITagRepository.IsUsed method
+func (mmIsUsed *mITagRepositoryMockIsUsed) Set(f func(ctx context.Context, ID int) (b1 bool, err error)) *ITagRepositoryMock {
+	if mmIsUsed.defaultExpectation != nil {
+		mmIsUsed.mock.t.Fatalf("Default expectation is already set for the ITagRepository.IsUsed method")
+	}
+
+	if len(mmIsUsed.expectations) > 0 {
+		mmIsUsed.mock.t.Fatalf("Some expectations are already set for the ITagRepository.IsUsed method")
+	}
+
+	mmIsUsed.mock.funcIsUsed = f
+	return mmIsUsed.mock
+}
+
+// When sets expectation for the ITagRepository.IsUsed which will trigger the result defined by the following
+// Then helper
+func (mmIsUsed *mITagRepositoryMockIsUsed) When(ctx context.Context, ID int) *ITagRepositoryMockIsUsedExpectation {
+	if mmIsUsed.mock.funcIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("ITagRepositoryMock.IsUsed mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockIsUsedExpectation{
+		mock:   mmIsUsed.mock,
+		params: &ITagRepositoryMockIsUsedParams{ctx, ID},
+	}
+	mmIsUsed.expectations = append(mmIsUsed.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.IsUsed return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockIsUsedExpectation) Then(b1 bool, err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockIsUsedResults{b1, err}
+	return e.mock
+}
+
+// IsUsed implements interfaces.ITagRepository
+func (mmIsUsed *ITagRepositoryMock) IsUsed(ctx context.Context, ID int) (b1 bool, err error) {
+	mm_atomic.AddUint64(&mmIsUsed.beforeIsUsedCounter, 1)
+	defer mm_atomic.AddUint64(&mmIsUsed.afterIsUsedCounter, 1)
+
+	if mmIsUsed.inspectFuncIsUsed != nil {
+		mmIsUsed.inspectFuncIsUsed(ctx, ID)
+	}
+
+	mm_params := &ITagRepositoryMockIsUsedParams{ctx, ID}
+
+	// Record call args
+	mmIsUsed.IsUsedMock.mutex.Lock()
+	mmIsUsed.IsUsedMock.callArgs = append(mmIsUsed.IsUsedMock.callArgs, mm_params)
+	mmIsUsed.IsUsedMock.mutex.Unlock()
+
+	for _, e := range mmIsUsed.IsUsedMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.b1, e.results.err
+		}
+	}
+
+	if mmIsUsed.IsUsedMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmIsUsed.IsUsedMock.defaultExpectation.Counter, 1)
+		mm_want := mmIsUsed.IsUsedMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockIsUsedParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmIsUsed.t.Errorf("ITagRepositoryMock.IsUsed got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmIsUsed.IsUsedMock.defaultExpectation.results
+		if mm_results == nil {
+			mmIsUsed.t.Fatal("No results are set for the ITagRepositoryMock.IsUsed")
+		}
+		return (*mm_results).b1, (*mm_results).err
+	}
+	if mmIsUsed.funcIsUsed != nil {
+		return mmIsUsed.funcIsUsed(ctx, ID)
+	}
+	mmIsUsed.t.Fatalf("Unexpected call to ITagRepositoryMock.IsUsed. %v %v", ctx, ID)
+	return
+}
+
+// IsUsedAfterCounter returns a count of finished ITagRepositoryMock.IsUsed invocations
+func (mmIsUsed *ITagRepositoryMock) IsUsedAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmIsUsed.afterIsUsedCounter)
+}
+
+// IsUsedBeforeCounter returns a count of ITagRepositoryMock.IsUsed invocations
+func (mmIsUsed *ITagRepositoryMock) IsUsedBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmIsUsed.beforeIsUsedCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.IsUsed.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmIsUsed *mITagRepositoryMockIsUsed) Calls() []*ITagRepositoryMockIsUsedParams {
+	mmIsUsed.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockIsUsedParams, len(mmIsUsed.callArgs))
+	copy(argCopy, mmIsUsed.callArgs)
+
+	mmIsUsed.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockIsUsedDone returns true if the count of the IsUsed invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockIsUsedDone() bool {
+	for _, e := range m.IsUsedMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.IsUsedMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterIsUsedCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcIsUsed != nil && mm_atomic.LoadUint64(&m.afterIsUsedCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockIsUsedInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockIsUsedInspect() {
+	for _, e := range m.IsUsedMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.IsUsed with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.IsUsedMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterIsUsedCounter) < 1 {
+		if m.IsUsedMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.IsUsed")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.IsUsed with params: %#v", *m.IsUsedMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcIsUsed != nil && mm_atomic.LoadUint64(&m.afterIsUsedCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.IsUsed")
+	}
+}
+
+type mITagRepositoryMockUpdate struct {
+	mock               *ITagRepositoryMock
+	defaultExpectation *ITagRepositoryMockUpdateExpectation
+	expectations       []*ITagRepositoryMockUpdateExpectation
+
+	callArgs []*ITagRepositoryMockUpdateParams
+	mutex    sync.RWMutex
+}
+
+// ITagRepositoryMockUpdateExpectation specifies expectation struct of the ITagRepository.Update
+type ITagRepositoryMockUpdateExpectation struct {
+	mock    *ITagRepositoryMock
+	params  *ITagRepositoryMockUpdateParams
+	results *ITagRepositoryMockUpdateResults
+	Counter uint64
+}
+
+// ITagRepositoryMockUpdateParams contains parameters of the ITagRepository.Update
+type ITagRepositoryMockUpdateParams struct {
+	ctx context.Context
+	m   models.Tag
+}
+
+// ITagRepositoryMockUpdateResults contains results of the ITagRepository.Update
+type ITagRepositoryMockUpdateResults struct {
+	err error
+}
+
+// Expect sets up expected params for ITagRepository.Update
+func (mmUpdate *mITagRepositoryMockUpdate) Expect(ctx context.Context, m models.Tag) *mITagRepositoryMockUpdate {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("ITagRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &ITagRepositoryMockUpdateExpectation{}
+	}
+
+	mmUpdate.defaultExpectation.params = &ITagRepositoryMockUpdateParams{ctx, m}
+	for _, e := range mmUpdate.expectations {
+		if minimock.Equal(e.params, mmUpdate.defaultExpectation.params) {
+			mmUpdate.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdate.defaultExpectation.params)
+		}
+	}
+
+	return mmUpdate
+}
+
+// Inspect accepts an inspector function that has same arguments as the ITagRepository.Update
+func (mmUpdate *mITagRepositoryMockUpdate) Inspect(f func(ctx context.Context, m models.Tag)) *mITagRepositoryMockUpdate {
+	if mmUpdate.mock.inspectFuncUpdate != nil {
+		mmUpdate.mock.t.Fatalf("Inspect function is already set for ITagRepositoryMock.Update")
+	}
+
+	mmUpdate.mock.inspectFuncUpdate = f
+
+	return mmUpdate
+}
+
+// Return sets up results that will be returned by ITagRepository.Update
+func (mmUpdate *mITagRepositoryMockUpdate) Return(err error) *ITagRepositoryMock {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("ITagRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &ITagRepositoryMockUpdateExpectation{mock: mmUpdate.mock}
+	}
+	mmUpdate.defaultExpectation.results = &ITagRepositoryMockUpdateResults{err}
+	return mmUpdate.mock
+}
+
+//Set uses given function f to mock the ITagRepository.Update method
+func (mmUpdate *mITagRepositoryMockUpdate) Set(f func(ctx context.Context, m models.Tag) (err error)) *ITagRepositoryMock {
+	if mmUpdate.defaultExpectation != nil {
+		mmUpdate.mock.t.Fatalf("Default expectation is already set for the ITagRepository.Update method")
+	}
+
+	if len(mmUpdate.expectations) > 0 {
+		mmUpdate.mock.t.Fatalf("Some expectations are already set for the ITagRepository.Update method")
+	}
+
+	mmUpdate.mock.funcUpdate = f
+	return mmUpdate.mock
+}
+
+// When sets expectation for the ITagRepository.Update which will trigger the result defined by the following
+// Then helper
+func (mmUpdate *mITagRepositoryMockUpdate) When(ctx context.Context, m models.Tag) *ITagRepositoryMockUpdateExpectation {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("ITagRepositoryMock.Update mock is already set by Set")
+	}
+
+	expectation := &ITagRepositoryMockUpdateExpectation{
+		mock:   mmUpdate.mock,
+		params: &ITagRepositoryMockUpdateParams{ctx, m},
+	}
+	mmUpdate.expectations = append(mmUpdate.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ITagRepository.Update return parameters for the expectation previously defined by the When method
+func (e *ITagRepositoryMockUpdateExpectation) Then(err error) *ITagRepositoryMock {
+	e.results = &ITagRepositoryMockUpdateResults{err}
+	return e.mock
+}
+
+// Update implements interfaces.ITagRepository
+func (mmUpdate *ITagRepositoryMock) Update(ctx context.Context, m models.Tag) (err error) {
+	mm_atomic.AddUint64(&mmUpdate.beforeUpdateCounter, 1)
+	defer mm_atomic.AddUint64(&mmUpdate.afterUpdateCounter, 1)
+
+	if mmUpdate.inspectFuncUpdate != nil {
+		mmUpdate.inspectFuncUpdate(ctx, m)
+	}
+
+	mm_params := &ITagRepositoryMockUpdateParams{ctx, m}
+
+	// Record call args
+	mmUpdate.UpdateMock.mutex.Lock()
+	mmUpdate.UpdateMock.callArgs = append(mmUpdate.UpdateMock.callArgs, mm_params)
+	mmUpdate.UpdateMock.mutex.Unlock()
+
+	for _, e := range mmUpdate.UpdateMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmUpdate.UpdateMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmUpdate.UpdateMock.defaultExpectation.Counter, 1)
+		mm_want := mmUpdate.UpdateMock.defaultExpectation.params
+		mm_got := ITagRepositoryMockUpdateParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmUpdate.t.Errorf("ITagRepositoryMock.Update got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmUpdate.UpdateMock.defaultExpectation.results
+		if mm_results == nil {
+			mmUpdate.t.Fatal("No results are set for the ITagRepositoryMock.Update")
+		}
+		return (*mm_results).err
+	}
+	if mmUpdate.funcUpdate != nil {
+		return mmUpdate.funcUpdate(ctx, m)
+	}
+	mmUpdate.t.Fatalf("Unexpected call to ITagRepositoryMock.Update. %v %v", ctx, m)
+	return
+}
+
+// UpdateAfterCounter returns a count of finished ITagRepositoryMock.Update invocations
+func (mmUpdate *ITagRepositoryMock) UpdateAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.afterUpdateCounter)
+}
+
+// UpdateBeforeCounter returns a count of ITagRepositoryMock.Update invocations
+func (mmUpdate *ITagRepositoryMock) UpdateBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.beforeUpdateCounter)
+}
+
+// Calls returns a list of arguments used in each call to ITagRepositoryMock.Update.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmUpdate *mITagRepositoryMockUpdate) Calls() []*ITagRepositoryMockUpdateParams {
+	mmUpdate.mutex.RLock()
+
+	argCopy := make([]*ITagRepositoryMockUpdateParams, len(mmUpdate.callArgs))
+	copy(argCopy, mmUpdate.callArgs)
+
+	mmUpdate.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockUpdateDone returns true if the count of the Update invocations corresponds
+// the number of defined expectations
+func (m *ITagRepositoryMock) MinimockUpdateDone() bool {
+	for _, e := range m.UpdateMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.UpdateMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcUpdate != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockUpdateInspect logs each unmet expectation
+func (m *ITagRepositoryMock) MinimockUpdateInspect() {
+	for _, e := range m.UpdateMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ITagRepositoryMock.Update with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.UpdateMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		if m.UpdateMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ITagRepositoryMock.Update")
+		} else {
+			m.t.Errorf("Expected call to ITagRepositoryMock.Update with params: %#v", *m.UpdateMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcUpdate != nil && mm_atomic.LoadUint64(&m.afterUpdateCounter) < 1 {
+		m.t.Error("Expected call to ITagRepositoryMock.Update")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *ITagRepositoryMock) MinimockFinish() {
+	if !m.minimockDone() {
+		m.MinimockAddInspect()
+
+		m.MinimockDeleteInspect()
+
+		m.MinimockGetAllInspect()
+
+		m.MinimockGetAllUsedInspect()
+
+		m.MinimockGetByArticleIDInspect()
+
+		m.MinimockGetByIDInspect()
+
+		m.MinimockGetByURLInspect()
+
+		m.MinimockIsUsedInspect()
+
+		m.MinimockUpdateInspect()
+		m.t.FailNow()
+	}
+}
+
+// MinimockWait waits for all mocked methods to be called the expected number of times
+func (m *ITagRepositoryMock) MinimockWait(timeout mm_time.Duration) {
+	timeoutCh := mm_time.After(timeout)
+	for {
+		if m.minimockDone() {
+			return
+		}
+		select {
+		case <-timeoutCh:
+			m.MinimockFinish()
+			return
+		case <-mm_time.After(10 * mm_time.Millisecond):
+		}
+	}
+}
+
+func (m *ITagRepositoryMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockAddDone() &&
+		m.MinimockDeleteDone() &&
+		m.MinimockGetAllDone() &&
+		m.MinimockGetAllUsedDone() &&
+		m.MinimockGetByArticleIDDone() &&
+		m.MinimockGetByIDDone() &&
+		m.MinimockGetByURLDone() &&
+		m.MinimockIsUsedDone() &&
+		m.MinimockUpdateDone()
+}

+ 4 - 0
internal/repositories/tag.go

@@ -1,5 +1,9 @@
 package repositories
 
+//go:generate mkdir -p mocks
+//go:generate rm -rf ./mocks/*_minimock.go
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.ITagRepository -o ./mocks/ -s "_minimock.go"
+
 import (
 	"context"
 	"database/sql"

+ 24 - 1
internal/service_provider/sp.go

@@ -18,7 +18,7 @@ type ServiceProvider struct {
 	articleTagRepository interfaces.IArticleTagRepository
 }
 
-func Init() (*ServiceProvider, error) {
+func Init() (interfaces.IServiceProvider, error) {
 	sp := &ServiceProvider{}
 
 	// Init env service
@@ -70,3 +70,26 @@ func (sp *ServiceProvider) GetTagRepository() interfaces.ITagRepository {
 func (sp *ServiceProvider) GetArticleTagRepository() interfaces.IArticleTagRepository {
 	return sp.articleTagRepository
 }
+
+func InitMock(deps ...interface{}) interfaces.IServiceProvider {
+	sp := ServiceProvider{}
+
+	for _, d := range deps {
+		switch s := d.(type) {
+		case interfaces.ICache:
+			sp.cache = s
+		case interfaces.IEnv:
+			sp.env = s
+		case interfaces.IMailer:
+			sp.mailer = s
+		case interfaces.IArticleRepository:
+			sp.articleRepository = s
+		case interfaces.IArticleTagRepository:
+			sp.articleTagRepository = s
+		case interfaces.ITagRepository:
+			sp.tagRepository = s
+		}
+	}
+
+	return &sp
+}

+ 4 - 0
internal/services/cache/cache.go

@@ -1,5 +1,9 @@
 package cache
 
+//go:generate mkdir -p mocks
+//go:generate rm -rf ./mocks/*_minimock.go
+//go:generate minimock -i ../../interfaces.ICache -o ./mocks/ -s "_minimock.go"
+
 import (
 	"sync"
 

+ 629 - 0
internal/services/cache/mocks/i_cache_minimock.go

@@ -0,0 +1,629 @@
+package mocks
+
+// Code generated by http://github.com/gojuno/minimock (dev). DO NOT EDIT.
+
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.ICache -o ./mocks/i_cache_minimock.go -n ICacheMock
+
+import (
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/gojuno/minimock/v3"
+)
+
+// ICacheMock implements interfaces.ICache
+type ICacheMock struct {
+	t minimock.Tester
+
+	funcFlushAll          func()
+	inspectFuncFlushAll   func()
+	afterFlushAllCounter  uint64
+	beforeFlushAllCounter uint64
+	FlushAllMock          mICacheMockFlushAll
+
+	funcGet          func(key string) (p1 interface{}, b1 bool)
+	inspectFuncGet   func(key string)
+	afterGetCounter  uint64
+	beforeGetCounter uint64
+	GetMock          mICacheMockGet
+
+	funcSet          func(key string, value interface{})
+	inspectFuncSet   func(key string, value interface{})
+	afterSetCounter  uint64
+	beforeSetCounter uint64
+	SetMock          mICacheMockSet
+}
+
+// NewICacheMock returns a mock for interfaces.ICache
+func NewICacheMock(t minimock.Tester) *ICacheMock {
+	m := &ICacheMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.FlushAllMock = mICacheMockFlushAll{mock: m}
+
+	m.GetMock = mICacheMockGet{mock: m}
+	m.GetMock.callArgs = []*ICacheMockGetParams{}
+
+	m.SetMock = mICacheMockSet{mock: m}
+	m.SetMock.callArgs = []*ICacheMockSetParams{}
+
+	return m
+}
+
+type mICacheMockFlushAll struct {
+	mock               *ICacheMock
+	defaultExpectation *ICacheMockFlushAllExpectation
+	expectations       []*ICacheMockFlushAllExpectation
+}
+
+// ICacheMockFlushAllExpectation specifies expectation struct of the ICache.FlushAll
+type ICacheMockFlushAllExpectation struct {
+	mock *ICacheMock
+
+	Counter uint64
+}
+
+// Expect sets up expected params for ICache.FlushAll
+func (mmFlushAll *mICacheMockFlushAll) Expect() *mICacheMockFlushAll {
+	if mmFlushAll.mock.funcFlushAll != nil {
+		mmFlushAll.mock.t.Fatalf("ICacheMock.FlushAll mock is already set by Set")
+	}
+
+	if mmFlushAll.defaultExpectation == nil {
+		mmFlushAll.defaultExpectation = &ICacheMockFlushAllExpectation{}
+	}
+
+	return mmFlushAll
+}
+
+// Inspect accepts an inspector function that has same arguments as the ICache.FlushAll
+func (mmFlushAll *mICacheMockFlushAll) Inspect(f func()) *mICacheMockFlushAll {
+	if mmFlushAll.mock.inspectFuncFlushAll != nil {
+		mmFlushAll.mock.t.Fatalf("Inspect function is already set for ICacheMock.FlushAll")
+	}
+
+	mmFlushAll.mock.inspectFuncFlushAll = f
+
+	return mmFlushAll
+}
+
+// Return sets up results that will be returned by ICache.FlushAll
+func (mmFlushAll *mICacheMockFlushAll) Return() *ICacheMock {
+	if mmFlushAll.mock.funcFlushAll != nil {
+		mmFlushAll.mock.t.Fatalf("ICacheMock.FlushAll mock is already set by Set")
+	}
+
+	if mmFlushAll.defaultExpectation == nil {
+		mmFlushAll.defaultExpectation = &ICacheMockFlushAllExpectation{mock: mmFlushAll.mock}
+	}
+
+	return mmFlushAll.mock
+}
+
+//Set uses given function f to mock the ICache.FlushAll method
+func (mmFlushAll *mICacheMockFlushAll) Set(f func()) *ICacheMock {
+	if mmFlushAll.defaultExpectation != nil {
+		mmFlushAll.mock.t.Fatalf("Default expectation is already set for the ICache.FlushAll method")
+	}
+
+	if len(mmFlushAll.expectations) > 0 {
+		mmFlushAll.mock.t.Fatalf("Some expectations are already set for the ICache.FlushAll method")
+	}
+
+	mmFlushAll.mock.funcFlushAll = f
+	return mmFlushAll.mock
+}
+
+// FlushAll implements interfaces.ICache
+func (mmFlushAll *ICacheMock) FlushAll() {
+	mm_atomic.AddUint64(&mmFlushAll.beforeFlushAllCounter, 1)
+	defer mm_atomic.AddUint64(&mmFlushAll.afterFlushAllCounter, 1)
+
+	if mmFlushAll.inspectFuncFlushAll != nil {
+		mmFlushAll.inspectFuncFlushAll()
+	}
+
+	if mmFlushAll.FlushAllMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmFlushAll.FlushAllMock.defaultExpectation.Counter, 1)
+
+		return
+
+	}
+	if mmFlushAll.funcFlushAll != nil {
+		mmFlushAll.funcFlushAll()
+		return
+	}
+	mmFlushAll.t.Fatalf("Unexpected call to ICacheMock.FlushAll.")
+
+}
+
+// FlushAllAfterCounter returns a count of finished ICacheMock.FlushAll invocations
+func (mmFlushAll *ICacheMock) FlushAllAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmFlushAll.afterFlushAllCounter)
+}
+
+// FlushAllBeforeCounter returns a count of ICacheMock.FlushAll invocations
+func (mmFlushAll *ICacheMock) FlushAllBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmFlushAll.beforeFlushAllCounter)
+}
+
+// MinimockFlushAllDone returns true if the count of the FlushAll invocations corresponds
+// the number of defined expectations
+func (m *ICacheMock) MinimockFlushAllDone() bool {
+	for _, e := range m.FlushAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.FlushAllMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterFlushAllCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcFlushAll != nil && mm_atomic.LoadUint64(&m.afterFlushAllCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockFlushAllInspect logs each unmet expectation
+func (m *ICacheMock) MinimockFlushAllInspect() {
+	for _, e := range m.FlushAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Error("Expected call to ICacheMock.FlushAll")
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.FlushAllMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterFlushAllCounter) < 1 {
+		m.t.Error("Expected call to ICacheMock.FlushAll")
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcFlushAll != nil && mm_atomic.LoadUint64(&m.afterFlushAllCounter) < 1 {
+		m.t.Error("Expected call to ICacheMock.FlushAll")
+	}
+}
+
+type mICacheMockGet struct {
+	mock               *ICacheMock
+	defaultExpectation *ICacheMockGetExpectation
+	expectations       []*ICacheMockGetExpectation
+
+	callArgs []*ICacheMockGetParams
+	mutex    sync.RWMutex
+}
+
+// ICacheMockGetExpectation specifies expectation struct of the ICache.Get
+type ICacheMockGetExpectation struct {
+	mock    *ICacheMock
+	params  *ICacheMockGetParams
+	results *ICacheMockGetResults
+	Counter uint64
+}
+
+// ICacheMockGetParams contains parameters of the ICache.Get
+type ICacheMockGetParams struct {
+	key string
+}
+
+// ICacheMockGetResults contains results of the ICache.Get
+type ICacheMockGetResults struct {
+	p1 interface{}
+	b1 bool
+}
+
+// Expect sets up expected params for ICache.Get
+func (mmGet *mICacheMockGet) Expect(key string) *mICacheMockGet {
+	if mmGet.mock.funcGet != nil {
+		mmGet.mock.t.Fatalf("ICacheMock.Get mock is already set by Set")
+	}
+
+	if mmGet.defaultExpectation == nil {
+		mmGet.defaultExpectation = &ICacheMockGetExpectation{}
+	}
+
+	mmGet.defaultExpectation.params = &ICacheMockGetParams{key}
+	for _, e := range mmGet.expectations {
+		if minimock.Equal(e.params, mmGet.defaultExpectation.params) {
+			mmGet.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGet.defaultExpectation.params)
+		}
+	}
+
+	return mmGet
+}
+
+// Inspect accepts an inspector function that has same arguments as the ICache.Get
+func (mmGet *mICacheMockGet) Inspect(f func(key string)) *mICacheMockGet {
+	if mmGet.mock.inspectFuncGet != nil {
+		mmGet.mock.t.Fatalf("Inspect function is already set for ICacheMock.Get")
+	}
+
+	mmGet.mock.inspectFuncGet = f
+
+	return mmGet
+}
+
+// Return sets up results that will be returned by ICache.Get
+func (mmGet *mICacheMockGet) Return(p1 interface{}, b1 bool) *ICacheMock {
+	if mmGet.mock.funcGet != nil {
+		mmGet.mock.t.Fatalf("ICacheMock.Get mock is already set by Set")
+	}
+
+	if mmGet.defaultExpectation == nil {
+		mmGet.defaultExpectation = &ICacheMockGetExpectation{mock: mmGet.mock}
+	}
+	mmGet.defaultExpectation.results = &ICacheMockGetResults{p1, b1}
+	return mmGet.mock
+}
+
+//Set uses given function f to mock the ICache.Get method
+func (mmGet *mICacheMockGet) Set(f func(key string) (p1 interface{}, b1 bool)) *ICacheMock {
+	if mmGet.defaultExpectation != nil {
+		mmGet.mock.t.Fatalf("Default expectation is already set for the ICache.Get method")
+	}
+
+	if len(mmGet.expectations) > 0 {
+		mmGet.mock.t.Fatalf("Some expectations are already set for the ICache.Get method")
+	}
+
+	mmGet.mock.funcGet = f
+	return mmGet.mock
+}
+
+// When sets expectation for the ICache.Get which will trigger the result defined by the following
+// Then helper
+func (mmGet *mICacheMockGet) When(key string) *ICacheMockGetExpectation {
+	if mmGet.mock.funcGet != nil {
+		mmGet.mock.t.Fatalf("ICacheMock.Get mock is already set by Set")
+	}
+
+	expectation := &ICacheMockGetExpectation{
+		mock:   mmGet.mock,
+		params: &ICacheMockGetParams{key},
+	}
+	mmGet.expectations = append(mmGet.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ICache.Get return parameters for the expectation previously defined by the When method
+func (e *ICacheMockGetExpectation) Then(p1 interface{}, b1 bool) *ICacheMock {
+	e.results = &ICacheMockGetResults{p1, b1}
+	return e.mock
+}
+
+// Get implements interfaces.ICache
+func (mmGet *ICacheMock) Get(key string) (p1 interface{}, b1 bool) {
+	mm_atomic.AddUint64(&mmGet.beforeGetCounter, 1)
+	defer mm_atomic.AddUint64(&mmGet.afterGetCounter, 1)
+
+	if mmGet.inspectFuncGet != nil {
+		mmGet.inspectFuncGet(key)
+	}
+
+	mm_params := &ICacheMockGetParams{key}
+
+	// Record call args
+	mmGet.GetMock.mutex.Lock()
+	mmGet.GetMock.callArgs = append(mmGet.GetMock.callArgs, mm_params)
+	mmGet.GetMock.mutex.Unlock()
+
+	for _, e := range mmGet.GetMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.p1, e.results.b1
+		}
+	}
+
+	if mmGet.GetMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmGet.GetMock.defaultExpectation.Counter, 1)
+		mm_want := mmGet.GetMock.defaultExpectation.params
+		mm_got := ICacheMockGetParams{key}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGet.t.Errorf("ICacheMock.Get got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmGet.GetMock.defaultExpectation.results
+		if mm_results == nil {
+			mmGet.t.Fatal("No results are set for the ICacheMock.Get")
+		}
+		return (*mm_results).p1, (*mm_results).b1
+	}
+	if mmGet.funcGet != nil {
+		return mmGet.funcGet(key)
+	}
+	mmGet.t.Fatalf("Unexpected call to ICacheMock.Get. %v", key)
+	return
+}
+
+// GetAfterCounter returns a count of finished ICacheMock.Get invocations
+func (mmGet *ICacheMock) GetAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGet.afterGetCounter)
+}
+
+// GetBeforeCounter returns a count of ICacheMock.Get invocations
+func (mmGet *ICacheMock) GetBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGet.beforeGetCounter)
+}
+
+// Calls returns a list of arguments used in each call to ICacheMock.Get.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGet *mICacheMockGet) Calls() []*ICacheMockGetParams {
+	mmGet.mutex.RLock()
+
+	argCopy := make([]*ICacheMockGetParams, len(mmGet.callArgs))
+	copy(argCopy, mmGet.callArgs)
+
+	mmGet.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockGetDone returns true if the count of the Get invocations corresponds
+// the number of defined expectations
+func (m *ICacheMock) MinimockGetDone() bool {
+	for _, e := range m.GetMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGet != nil && mm_atomic.LoadUint64(&m.afterGetCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockGetInspect logs each unmet expectation
+func (m *ICacheMock) MinimockGetInspect() {
+	for _, e := range m.GetMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ICacheMock.Get with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.GetMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetCounter) < 1 {
+		if m.GetMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ICacheMock.Get")
+		} else {
+			m.t.Errorf("Expected call to ICacheMock.Get with params: %#v", *m.GetMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcGet != nil && mm_atomic.LoadUint64(&m.afterGetCounter) < 1 {
+		m.t.Error("Expected call to ICacheMock.Get")
+	}
+}
+
+type mICacheMockSet struct {
+	mock               *ICacheMock
+	defaultExpectation *ICacheMockSetExpectation
+	expectations       []*ICacheMockSetExpectation
+
+	callArgs []*ICacheMockSetParams
+	mutex    sync.RWMutex
+}
+
+// ICacheMockSetExpectation specifies expectation struct of the ICache.Set
+type ICacheMockSetExpectation struct {
+	mock   *ICacheMock
+	params *ICacheMockSetParams
+
+	Counter uint64
+}
+
+// ICacheMockSetParams contains parameters of the ICache.Set
+type ICacheMockSetParams struct {
+	key   string
+	value interface{}
+}
+
+// Expect sets up expected params for ICache.Set
+func (mmSet *mICacheMockSet) Expect(key string, value interface{}) *mICacheMockSet {
+	if mmSet.mock.funcSet != nil {
+		mmSet.mock.t.Fatalf("ICacheMock.Set mock is already set by Set")
+	}
+
+	if mmSet.defaultExpectation == nil {
+		mmSet.defaultExpectation = &ICacheMockSetExpectation{}
+	}
+
+	mmSet.defaultExpectation.params = &ICacheMockSetParams{key, value}
+	for _, e := range mmSet.expectations {
+		if minimock.Equal(e.params, mmSet.defaultExpectation.params) {
+			mmSet.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmSet.defaultExpectation.params)
+		}
+	}
+
+	return mmSet
+}
+
+// Inspect accepts an inspector function that has same arguments as the ICache.Set
+func (mmSet *mICacheMockSet) Inspect(f func(key string, value interface{})) *mICacheMockSet {
+	if mmSet.mock.inspectFuncSet != nil {
+		mmSet.mock.t.Fatalf("Inspect function is already set for ICacheMock.Set")
+	}
+
+	mmSet.mock.inspectFuncSet = f
+
+	return mmSet
+}
+
+// Return sets up results that will be returned by ICache.Set
+func (mmSet *mICacheMockSet) Return() *ICacheMock {
+	if mmSet.mock.funcSet != nil {
+		mmSet.mock.t.Fatalf("ICacheMock.Set mock is already set by Set")
+	}
+
+	if mmSet.defaultExpectation == nil {
+		mmSet.defaultExpectation = &ICacheMockSetExpectation{mock: mmSet.mock}
+	}
+
+	return mmSet.mock
+}
+
+//Set uses given function f to mock the ICache.Set method
+func (mmSet *mICacheMockSet) Set(f func(key string, value interface{})) *ICacheMock {
+	if mmSet.defaultExpectation != nil {
+		mmSet.mock.t.Fatalf("Default expectation is already set for the ICache.Set method")
+	}
+
+	if len(mmSet.expectations) > 0 {
+		mmSet.mock.t.Fatalf("Some expectations are already set for the ICache.Set method")
+	}
+
+	mmSet.mock.funcSet = f
+	return mmSet.mock
+}
+
+// Set implements interfaces.ICache
+func (mmSet *ICacheMock) Set(key string, value interface{}) {
+	mm_atomic.AddUint64(&mmSet.beforeSetCounter, 1)
+	defer mm_atomic.AddUint64(&mmSet.afterSetCounter, 1)
+
+	if mmSet.inspectFuncSet != nil {
+		mmSet.inspectFuncSet(key, value)
+	}
+
+	mm_params := &ICacheMockSetParams{key, value}
+
+	// Record call args
+	mmSet.SetMock.mutex.Lock()
+	mmSet.SetMock.callArgs = append(mmSet.SetMock.callArgs, mm_params)
+	mmSet.SetMock.mutex.Unlock()
+
+	for _, e := range mmSet.SetMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return
+		}
+	}
+
+	if mmSet.SetMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmSet.SetMock.defaultExpectation.Counter, 1)
+		mm_want := mmSet.SetMock.defaultExpectation.params
+		mm_got := ICacheMockSetParams{key, value}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmSet.t.Errorf("ICacheMock.Set got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		return
+
+	}
+	if mmSet.funcSet != nil {
+		mmSet.funcSet(key, value)
+		return
+	}
+	mmSet.t.Fatalf("Unexpected call to ICacheMock.Set. %v %v", key, value)
+
+}
+
+// SetAfterCounter returns a count of finished ICacheMock.Set invocations
+func (mmSet *ICacheMock) SetAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmSet.afterSetCounter)
+}
+
+// SetBeforeCounter returns a count of ICacheMock.Set invocations
+func (mmSet *ICacheMock) SetBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmSet.beforeSetCounter)
+}
+
+// Calls returns a list of arguments used in each call to ICacheMock.Set.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmSet *mICacheMockSet) Calls() []*ICacheMockSetParams {
+	mmSet.mutex.RLock()
+
+	argCopy := make([]*ICacheMockSetParams, len(mmSet.callArgs))
+	copy(argCopy, mmSet.callArgs)
+
+	mmSet.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockSetDone returns true if the count of the Set invocations corresponds
+// the number of defined expectations
+func (m *ICacheMock) MinimockSetDone() bool {
+	for _, e := range m.SetMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.SetMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterSetCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcSet != nil && mm_atomic.LoadUint64(&m.afterSetCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockSetInspect logs each unmet expectation
+func (m *ICacheMock) MinimockSetInspect() {
+	for _, e := range m.SetMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ICacheMock.Set with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.SetMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterSetCounter) < 1 {
+		if m.SetMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to ICacheMock.Set")
+		} else {
+			m.t.Errorf("Expected call to ICacheMock.Set with params: %#v", *m.SetMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcSet != nil && mm_atomic.LoadUint64(&m.afterSetCounter) < 1 {
+		m.t.Error("Expected call to ICacheMock.Set")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *ICacheMock) MinimockFinish() {
+	if !m.minimockDone() {
+		m.MinimockFlushAllInspect()
+
+		m.MinimockGetInspect()
+
+		m.MinimockSetInspect()
+		m.t.FailNow()
+	}
+}
+
+// MinimockWait waits for all mocked methods to be called the expected number of times
+func (m *ICacheMock) MinimockWait(timeout mm_time.Duration) {
+	timeoutCh := mm_time.After(timeout)
+	for {
+		if m.minimockDone() {
+			return
+		}
+		select {
+		case <-timeoutCh:
+			m.MinimockFinish()
+			return
+		case <-mm_time.After(10 * mm_time.Millisecond):
+		}
+	}
+}
+
+func (m *ICacheMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockFlushAllDone() &&
+		m.MinimockGetDone() &&
+		m.MinimockSetDone()
+}

+ 4 - 0
internal/services/mailer/mailer.go

@@ -1,5 +1,9 @@
 package mailer
 
+//go:generate mkdir -p mocks
+//go:generate rm -rf ./mocks/*_minimock.go
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.IMailer -o ./mocks/ -s "_minimock.go"
+
 import (
 	"fmt"
 	"net/smtp"

+ 284 - 0
internal/services/mailer/mocks/i_mailer_minimock.go

@@ -0,0 +1,284 @@
+package mocks
+
+// Code generated by http://github.com/gojuno/minimock (dev). DO NOT EDIT.
+
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.IMailer -o ./mocks/i_mailer_minimock.go -n IMailerMock
+
+import (
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/gojuno/minimock/v3"
+)
+
+// IMailerMock implements interfaces.IMailer
+type IMailerMock struct {
+	t minimock.Tester
+
+	funcSend          func(recipient string, subject string, text string) (err error)
+	inspectFuncSend   func(recipient string, subject string, text string)
+	afterSendCounter  uint64
+	beforeSendCounter uint64
+	SendMock          mIMailerMockSend
+}
+
+// NewIMailerMock returns a mock for interfaces.IMailer
+func NewIMailerMock(t minimock.Tester) *IMailerMock {
+	m := &IMailerMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.SendMock = mIMailerMockSend{mock: m}
+	m.SendMock.callArgs = []*IMailerMockSendParams{}
+
+	return m
+}
+
+type mIMailerMockSend struct {
+	mock               *IMailerMock
+	defaultExpectation *IMailerMockSendExpectation
+	expectations       []*IMailerMockSendExpectation
+
+	callArgs []*IMailerMockSendParams
+	mutex    sync.RWMutex
+}
+
+// IMailerMockSendExpectation specifies expectation struct of the IMailer.Send
+type IMailerMockSendExpectation struct {
+	mock    *IMailerMock
+	params  *IMailerMockSendParams
+	results *IMailerMockSendResults
+	Counter uint64
+}
+
+// IMailerMockSendParams contains parameters of the IMailer.Send
+type IMailerMockSendParams struct {
+	recipient string
+	subject   string
+	text      string
+}
+
+// IMailerMockSendResults contains results of the IMailer.Send
+type IMailerMockSendResults struct {
+	err error
+}
+
+// Expect sets up expected params for IMailer.Send
+func (mmSend *mIMailerMockSend) Expect(recipient string, subject string, text string) *mIMailerMockSend {
+	if mmSend.mock.funcSend != nil {
+		mmSend.mock.t.Fatalf("IMailerMock.Send mock is already set by Set")
+	}
+
+	if mmSend.defaultExpectation == nil {
+		mmSend.defaultExpectation = &IMailerMockSendExpectation{}
+	}
+
+	mmSend.defaultExpectation.params = &IMailerMockSendParams{recipient, subject, text}
+	for _, e := range mmSend.expectations {
+		if minimock.Equal(e.params, mmSend.defaultExpectation.params) {
+			mmSend.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmSend.defaultExpectation.params)
+		}
+	}
+
+	return mmSend
+}
+
+// Inspect accepts an inspector function that has same arguments as the IMailer.Send
+func (mmSend *mIMailerMockSend) Inspect(f func(recipient string, subject string, text string)) *mIMailerMockSend {
+	if mmSend.mock.inspectFuncSend != nil {
+		mmSend.mock.t.Fatalf("Inspect function is already set for IMailerMock.Send")
+	}
+
+	mmSend.mock.inspectFuncSend = f
+
+	return mmSend
+}
+
+// Return sets up results that will be returned by IMailer.Send
+func (mmSend *mIMailerMockSend) Return(err error) *IMailerMock {
+	if mmSend.mock.funcSend != nil {
+		mmSend.mock.t.Fatalf("IMailerMock.Send mock is already set by Set")
+	}
+
+	if mmSend.defaultExpectation == nil {
+		mmSend.defaultExpectation = &IMailerMockSendExpectation{mock: mmSend.mock}
+	}
+	mmSend.defaultExpectation.results = &IMailerMockSendResults{err}
+	return mmSend.mock
+}
+
+//Set uses given function f to mock the IMailer.Send method
+func (mmSend *mIMailerMockSend) Set(f func(recipient string, subject string, text string) (err error)) *IMailerMock {
+	if mmSend.defaultExpectation != nil {
+		mmSend.mock.t.Fatalf("Default expectation is already set for the IMailer.Send method")
+	}
+
+	if len(mmSend.expectations) > 0 {
+		mmSend.mock.t.Fatalf("Some expectations are already set for the IMailer.Send method")
+	}
+
+	mmSend.mock.funcSend = f
+	return mmSend.mock
+}
+
+// When sets expectation for the IMailer.Send which will trigger the result defined by the following
+// Then helper
+func (mmSend *mIMailerMockSend) When(recipient string, subject string, text string) *IMailerMockSendExpectation {
+	if mmSend.mock.funcSend != nil {
+		mmSend.mock.t.Fatalf("IMailerMock.Send mock is already set by Set")
+	}
+
+	expectation := &IMailerMockSendExpectation{
+		mock:   mmSend.mock,
+		params: &IMailerMockSendParams{recipient, subject, text},
+	}
+	mmSend.expectations = append(mmSend.expectations, expectation)
+	return expectation
+}
+
+// Then sets up IMailer.Send return parameters for the expectation previously defined by the When method
+func (e *IMailerMockSendExpectation) Then(err error) *IMailerMock {
+	e.results = &IMailerMockSendResults{err}
+	return e.mock
+}
+
+// Send implements interfaces.IMailer
+func (mmSend *IMailerMock) Send(recipient string, subject string, text string) (err error) {
+	mm_atomic.AddUint64(&mmSend.beforeSendCounter, 1)
+	defer mm_atomic.AddUint64(&mmSend.afterSendCounter, 1)
+
+	if mmSend.inspectFuncSend != nil {
+		mmSend.inspectFuncSend(recipient, subject, text)
+	}
+
+	mm_params := &IMailerMockSendParams{recipient, subject, text}
+
+	// Record call args
+	mmSend.SendMock.mutex.Lock()
+	mmSend.SendMock.callArgs = append(mmSend.SendMock.callArgs, mm_params)
+	mmSend.SendMock.mutex.Unlock()
+
+	for _, e := range mmSend.SendMock.expectations {
+		if minimock.Equal(e.params, mm_params) {
+			mm_atomic.AddUint64(&e.Counter, 1)
+			return e.results.err
+		}
+	}
+
+	if mmSend.SendMock.defaultExpectation != nil {
+		mm_atomic.AddUint64(&mmSend.SendMock.defaultExpectation.Counter, 1)
+		mm_want := mmSend.SendMock.defaultExpectation.params
+		mm_got := IMailerMockSendParams{recipient, subject, text}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmSend.t.Errorf("IMailerMock.Send got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
+		}
+
+		mm_results := mmSend.SendMock.defaultExpectation.results
+		if mm_results == nil {
+			mmSend.t.Fatal("No results are set for the IMailerMock.Send")
+		}
+		return (*mm_results).err
+	}
+	if mmSend.funcSend != nil {
+		return mmSend.funcSend(recipient, subject, text)
+	}
+	mmSend.t.Fatalf("Unexpected call to IMailerMock.Send. %v %v %v", recipient, subject, text)
+	return
+}
+
+// SendAfterCounter returns a count of finished IMailerMock.Send invocations
+func (mmSend *IMailerMock) SendAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmSend.afterSendCounter)
+}
+
+// SendBeforeCounter returns a count of IMailerMock.Send invocations
+func (mmSend *IMailerMock) SendBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmSend.beforeSendCounter)
+}
+
+// Calls returns a list of arguments used in each call to IMailerMock.Send.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmSend *mIMailerMockSend) Calls() []*IMailerMockSendParams {
+	mmSend.mutex.RLock()
+
+	argCopy := make([]*IMailerMockSendParams, len(mmSend.callArgs))
+	copy(argCopy, mmSend.callArgs)
+
+	mmSend.mutex.RUnlock()
+
+	return argCopy
+}
+
+// MinimockSendDone returns true if the count of the Send invocations corresponds
+// the number of defined expectations
+func (m *IMailerMock) MinimockSendDone() bool {
+	for _, e := range m.SendMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			return false
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.SendMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterSendCounter) < 1 {
+		return false
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcSend != nil && mm_atomic.LoadUint64(&m.afterSendCounter) < 1 {
+		return false
+	}
+	return true
+}
+
+// MinimockSendInspect logs each unmet expectation
+func (m *IMailerMock) MinimockSendInspect() {
+	for _, e := range m.SendMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to IMailerMock.Send with params: %#v", *e.params)
+		}
+	}
+
+	// if default expectation was set then invocations count should be greater than zero
+	if m.SendMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterSendCounter) < 1 {
+		if m.SendMock.defaultExpectation.params == nil {
+			m.t.Error("Expected call to IMailerMock.Send")
+		} else {
+			m.t.Errorf("Expected call to IMailerMock.Send with params: %#v", *m.SendMock.defaultExpectation.params)
+		}
+	}
+	// if func was set then invocations count should be greater than zero
+	if m.funcSend != nil && mm_atomic.LoadUint64(&m.afterSendCounter) < 1 {
+		m.t.Error("Expected call to IMailerMock.Send")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *IMailerMock) MinimockFinish() {
+	if !m.minimockDone() {
+		m.MinimockSendInspect()
+		m.t.FailNow()
+	}
+}
+
+// MinimockWait waits for all mocked methods to be called the expected number of times
+func (m *IMailerMock) MinimockWait(timeout mm_time.Duration) {
+	timeoutCh := mm_time.After(timeout)
+	for {
+		if m.minimockDone() {
+			return
+		}
+		select {
+		case <-timeoutCh:
+			m.MinimockFinish()
+			return
+		case <-mm_time.After(10 * mm_time.Millisecond):
+		}
+	}
+}
+
+func (m *IMailerMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockSendDone()
+}