Browse Source

Update repositories

Dima 1 year ago
parent
commit
04f46e9cc2

+ 83 - 50
internal/repositories/article.go

@@ -2,33 +2,42 @@ 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"
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.ArticleRepository -o ./mocks/ -s "_minimock.go"
 
 import (
 	"context"
 	"database/sql"
 
+	sq "github.com/Masterminds/squirrel"
 	"github.com/dmitriygnatenko/internal/interfaces"
 	"github.com/dmitriygnatenko/internal/models"
 )
 
+const articleTableName = "article"
+
 type articleRepository struct {
 	db *sql.DB
 }
 
-func InitArticleRepository(db *sql.DB) interfaces.IArticleRepository {
+func InitArticleRepository(db *sql.DB) interfaces.ArticleRepository {
 	return articleRepository{db: db}
 }
 
 func (a articleRepository) GetAllPreview(ctx context.Context) ([]models.ArticlePreview, error) {
 	var res []models.ArticlePreview
 
-	query := "SELECT id, url, publish_time, title, preview_text, image " +
-		"FROM " + articleTableName + " " +
-		"WHERE is_active = 1 " +
-		"ORDER BY publish_time DESC"
+	query, args, err := sq.Select("id", "url", "publish_time", "title", "preview_text", "image").
+		From(articleTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"is_active": true}).
+		OrderBy("publish_time DESC").
+		ToSql()
+
+	if err != nil {
+		return nil, err
+	}
 
-	rows, err := a.db.QueryContext(ctx, query)
+	rows, err := a.db.QueryContext(ctx, query, args)
 	if err != nil {
 		return nil, err
 	}
@@ -37,14 +46,7 @@ func (a articleRepository) GetAllPreview(ctx context.Context) ([]models.ArticleP
 	for rows.Next() {
 		row := models.ArticlePreview{}
 
-		err = rows.Scan(
-			&row.ID,
-			&row.URL,
-			&row.PublishTime,
-			&row.Title,
-			&row.PreviewText,
-			&row.Image,
-		)
+		err = rows.Scan(&row.ID, &row.URL, &row.PublishTime, &row.Title, &row.PreviewText, &row.Image)
 		if err != nil {
 			return nil, err
 		}
@@ -62,11 +64,12 @@ func (a articleRepository) GetAllPreview(ctx context.Context) ([]models.ArticleP
 func (a articleRepository) GetAll(ctx context.Context) ([]models.Article, error) {
 	var res []models.Article
 
-	query := "SELECT id, url, publish_time, title, image, text, preview_text, meta_keywords, meta_desc, is_active " +
-		"FROM " + articleTableName + " " +
-		"ORDER BY publish_time DESC"
+	query, args, err := sq.Select("id", "url", "publish_time", "title", "image", "text", "preview_text", "meta_keywords", "meta_desc", "is_active").
+		From(articleTableName).
+		OrderBy("publish_time DESC").
+		ToSql()
 
-	rows, err := a.db.QueryContext(ctx, query)
+	rows, err := a.db.QueryContext(ctx, query, args)
 	if err != nil {
 		return nil, err
 	}
@@ -95,7 +98,7 @@ func (a articleRepository) GetPreviewByTagID(ctx context.Context, tagID int) ([]
 
 	query := "SELECT a.id, a.url, a.publish_time, a.title, a.preview_text, a.image " +
 		"FROM " + articleTableName + " a, " + articleTagTableName + " at " +
-		"WHERE a.is_active = 1 AND at.article_id = a.id AND at.tag_id = ? " +
+		"WHERE a.is_active = true AND at.article_id = a.id AND at.tag_id = ? " +
 		"ORDER BY a.publish_time DESC"
 
 	rows, err := a.db.QueryContext(ctx, query, tagID)
@@ -107,14 +110,7 @@ func (a articleRepository) GetPreviewByTagID(ctx context.Context, tagID int) ([]
 	for rows.Next() {
 		row := models.ArticlePreview{}
 
-		err = rows.Scan(
-			&row.ID,
-			&row.URL,
-			&row.PublishTime,
-			&row.Title,
-			&row.PreviewText,
-			&row.Image,
-		)
+		err = rows.Scan(&row.ID, &row.URL, &row.PublishTime, &row.Title, &row.PreviewText, &row.Image)
 		if err != nil {
 			return nil, err
 		}
@@ -132,11 +128,18 @@ func (a articleRepository) GetPreviewByTagID(ctx context.Context, tagID int) ([]
 func (a articleRepository) GetByURL(ctx context.Context, url string) (*models.Article, error) {
 	var res models.Article
 
-	query := "SELECT id, url, publish_time, title, image, text, preview_text, meta_keywords, meta_desc, is_active " +
-		"FROM " + articleTableName + " " +
-		"WHERE url = ? LIMIT 1"
+	query, args, err := sq.Select("id", "url", "publish_time", "title", "image", "text", "preview_text", "meta_keywords", "meta_desc", "is_active").
+		From(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"url": url}).
+		Limit(1).
+		ToSql()
 
-	err := a.db.QueryRowContext(ctx, query, url).
+	if err != nil {
+		return nil, err
+	}
+
+	err = a.db.QueryRowContext(ctx, query, args...).
 		Scan(&res.ID, &res.URL, &res.PublishTime, &res.Title, &res.Image, &res.Text, &res.PreviewText, &res.MetaKeywords, &res.MetaDescription, &res.IsActive)
 
 	if err != nil {
@@ -149,11 +152,18 @@ func (a articleRepository) GetByURL(ctx context.Context, url string) (*models.Ar
 func (a articleRepository) GetByID(ctx context.Context, id int) (*models.Article, error) {
 	var res models.Article
 
-	query := "SELECT id, url, publish_time, title, image, text, preview_text, meta_keywords, meta_desc, is_active " +
-		"FROM " + articleTableName + " " +
-		"WHERE id = ? LIMIT 1"
+	query, args, err := sq.Select("id", "url", "publish_time", "title", "image", "text", "preview_text", "meta_keywords", "meta_desc", "is_active").
+		From(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"id": id}).
+		Limit(1).
+		ToSql()
 
-	err := a.db.QueryRowContext(ctx, query, id).
+	if err != nil {
+		return nil, err
+	}
+
+	err = a.db.QueryRowContext(ctx, query, args...).
 		Scan(&res.ID, &res.URL, &res.PublishTime, &res.Title, &res.Image, &res.Text, &res.PreviewText, &res.MetaKeywords, &res.MetaDescription, &res.IsActive)
 
 	if err != nil {
@@ -164,38 +174,61 @@ func (a articleRepository) GetByID(ctx context.Context, id int) (*models.Article
 }
 
 func (a articleRepository) Add(ctx context.Context, m models.Article) (int, error) {
-	query := "INSERT INTO " + articleTableName + " " +
-		"(url, publish_time, title, image, text, preview_text, meta_keywords, meta_desc, is_active) " +
-		"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"
+	query, args, err := sq.Insert(articleTableName).
+		PlaceholderFormat(sq.Dollar).
+		Columns("url", "publish_time", "title", "image", "text", "preview_text", "meta_keywords", "meta_desc", "is_active").
+		Values(m.URL, m.PublishTime, m.Title, m.Image, m.Text, m.PreviewText, m.MetaKeywords, m.MetaDescription, m.IsActive).
+		Suffix("RETURNING id").
+		ToSql()
 
-	res, err := a.db.ExecContext(ctx, query, m.URL, m.PublishTime, m.Title, m.Image, m.Text, m.PreviewText, m.MetaKeywords, m.MetaDescription, m.IsActive)
 	if err != nil {
 		return 0, err
 	}
 
-	id, err := res.LastInsertId()
+	var id int
+	err = a.db.QueryRowContext(ctx, query, args...).Scan(&id)
 	if err != nil {
 		return 0, err
 	}
 
-	return int(id), err
+	return id, nil
 }
 
-func (a articleRepository) Update(ctx context.Context, m models.Article) error {
-	query := "UPDATE " + articleTableName + " " +
-		"SET url = ?, publish_time = ?, title = ?, image = ?, text = ?, preview_text = ?, meta_keywords = ?, " +
-		" meta_desc = ?, is_active = ? WHERE id = ?"
+func (a articleRepository) Update(ctx context.Context, req models.Article) error {
+	query, args, err := sq.Update(articleTableName).
+		PlaceholderFormat(sq.Dollar).
+		Set("url", req.URL).
+		Set("publish_time", req.PublishTime).
+		Set("title", req.Title).
+		Set("image", req.Image).
+		Set("text", req.Text).
+		Set("preview_text", req.PreviewText).
+		Set("meta_keywords", req.MetaKeywords).
+		Set("meta_desc", req.MetaDescription).
+		Set("is_active", req.IsActive).
+		Where(sq.Eq{"id": req.ID}).
+		ToSql()
 
-	_, err := a.db.ExecContext(ctx, query, m.URL, m.PublishTime, m.Title, m.Image, m.Text, m.PreviewText,
-		m.MetaKeywords, m.MetaDescription, m.IsActive, m.ID)
+	if err != nil {
+		return err
+	}
+
+	_, err = a.db.ExecContext(ctx, query, args...)
 
 	return err
 }
 
 func (a articleRepository) Delete(ctx context.Context, id int) error {
-	query := "DELETE FROM " + articleTableName + " WHERE id = ?"
+	query, args, err := sq.Delete(articleTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"id": id}).
+		ToSql()
+
+	if err != nil {
+		return err
+	}
 
-	_, err := a.db.ExecContext(ctx, query, id)
+	_, err = a.db.ExecContext(ctx, query, args...)
 
 	return err
 }

+ 32 - 18
internal/repositories/article_tag.go

@@ -2,20 +2,23 @@ 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"
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.ArticleTagRepository -o ./mocks/ -s "_minimock.go"
 
 import (
 	"context"
 	"database/sql"
 
+	sq "github.com/Masterminds/squirrel"
 	"github.com/dmitriygnatenko/internal/interfaces"
 )
 
+const articleTagTableName = "article_tag"
+
 type articleTagRepository struct {
 	db *sql.DB
 }
 
-func InitArticleTagRepository(db *sql.DB) interfaces.IArticleTagRepository {
+func InitArticleTagRepository(db *sql.DB) interfaces.ArticleTagRepository {
 	return articleTagRepository{db: db}
 }
 
@@ -24,16 +27,20 @@ func (a articleTagRepository) Add(ctx context.Context, articleID int, tagIDs []i
 		return nil
 	}
 
-	query := "INSERT INTO " + articleTagTableName + " (article_id, tag_id) VALUES "
+	qb := sq.Insert(articleTagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Columns("article_id", "tag_id")
 
-	vals := make([]interface{}, 0, len(tagIDs)*2)
 	for _, tagID := range tagIDs {
-		query += "(?, ?),"
-		vals = append(vals, articleID, tagID)
+		qb = qb.Values(articleID, tagID)
+	}
+
+	query, args, err := qb.ToSql()
+	if err != nil {
+		return err
 	}
-	query = query[0 : len(query)-1]
 
-	_, err := a.db.ExecContext(ctx, query, vals...)
+	_, err = a.db.ExecContext(ctx, query, args...)
 
 	return err
 }
@@ -43,25 +50,32 @@ func (a articleTagRepository) Delete(ctx context.Context, articleID int, tagIDs
 		return nil
 	}
 
-	query := "DELETE FROM " + articleTagTableName + " WHERE article_id = ? AND tag_id IN ("
+	query, args, err := sq.Delete(articleTagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"article_id": articleID}).
+		Where(sq.Eq{"tag_id": tagIDs}).
+		ToSql()
 
-	vals := make([]interface{}, 0, len(tagIDs)+1)
-	vals = append(vals, articleID)
-	for _, tagID := range tagIDs {
-		query += "?,"
-		vals = append(vals, tagID)
+	if err != nil {
+		return err
 	}
-	query = query[0:len(query)-1] + ")"
 
-	_, err := a.db.ExecContext(ctx, query, vals...)
+	_, err = a.db.ExecContext(ctx, query, args...)
 
 	return err
 }
 
 func (a articleTagRepository) DeleteByArticleID(ctx context.Context, articleID int) error {
-	query := "DELETE FROM " + articleTagTableName + " WHERE article_id = ?"
+	query, args, err := sq.Delete(articleTagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"article_id": articleID}).
+		ToSql()
+
+	if err != nil {
+		return err
+	}
 
-	_, err := a.db.ExecContext(ctx, query, articleID)
+	_, err = a.db.ExecContext(ctx, query, args...)
 
 	return err
 }

+ 1885 - 0
internal/repositories/mocks/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.ArticleRepository -o ./mocks/article_repository_minimock.go -n ArticleRepositoryMock
+
+import (
+	"context"
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/dmitriygnatenko/internal/models"
+	"github.com/gojuno/minimock/v3"
+)
+
+// ArticleRepositoryMock implements interfaces.ArticleRepository
+type ArticleRepositoryMock 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          mArticleRepositoryMockAdd
+
+	funcDelete          func(ctx context.Context, ID int) (err error)
+	inspectFuncDelete   func(ctx context.Context, ID int)
+	afterDeleteCounter  uint64
+	beforeDeleteCounter uint64
+	DeleteMock          mArticleRepositoryMockDelete
+
+	funcGetAll          func(ctx context.Context) (aa1 []models.Article, err error)
+	inspectFuncGetAll   func(ctx context.Context)
+	afterGetAllCounter  uint64
+	beforeGetAllCounter uint64
+	GetAllMock          mArticleRepositoryMockGetAll
+
+	funcGetAllPreview          func(ctx context.Context) (aa1 []models.ArticlePreview, err error)
+	inspectFuncGetAllPreview   func(ctx context.Context)
+	afterGetAllPreviewCounter  uint64
+	beforeGetAllPreviewCounter uint64
+	GetAllPreviewMock          mArticleRepositoryMockGetAllPreview
+
+	funcGetByID          func(ctx context.Context, ID int) (ap1 *models.Article, err error)
+	inspectFuncGetByID   func(ctx context.Context, ID int)
+	afterGetByIDCounter  uint64
+	beforeGetByIDCounter uint64
+	GetByIDMock          mArticleRepositoryMockGetByID
+
+	funcGetByURL          func(ctx context.Context, url string) (ap1 *models.Article, err error)
+	inspectFuncGetByURL   func(ctx context.Context, url string)
+	afterGetByURLCounter  uint64
+	beforeGetByURLCounter uint64
+	GetByURLMock          mArticleRepositoryMockGetByURL
+
+	funcGetPreviewByTagID          func(ctx context.Context, tagID int) (aa1 []models.ArticlePreview, err error)
+	inspectFuncGetPreviewByTagID   func(ctx context.Context, tagID int)
+	afterGetPreviewByTagIDCounter  uint64
+	beforeGetPreviewByTagIDCounter uint64
+	GetPreviewByTagIDMock          mArticleRepositoryMockGetPreviewByTagID
+
+	funcUpdate          func(ctx context.Context, m models.Article) (err error)
+	inspectFuncUpdate   func(ctx context.Context, m models.Article)
+	afterUpdateCounter  uint64
+	beforeUpdateCounter uint64
+	UpdateMock          mArticleRepositoryMockUpdate
+}
+
+// NewArticleRepositoryMock returns a mock for interfaces.ArticleRepository
+func NewArticleRepositoryMock(t minimock.Tester) *ArticleRepositoryMock {
+	m := &ArticleRepositoryMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.AddMock = mArticleRepositoryMockAdd{mock: m}
+	m.AddMock.callArgs = []*ArticleRepositoryMockAddParams{}
+
+	m.DeleteMock = mArticleRepositoryMockDelete{mock: m}
+	m.DeleteMock.callArgs = []*ArticleRepositoryMockDeleteParams{}
+
+	m.GetAllMock = mArticleRepositoryMockGetAll{mock: m}
+	m.GetAllMock.callArgs = []*ArticleRepositoryMockGetAllParams{}
+
+	m.GetAllPreviewMock = mArticleRepositoryMockGetAllPreview{mock: m}
+	m.GetAllPreviewMock.callArgs = []*ArticleRepositoryMockGetAllPreviewParams{}
+
+	m.GetByIDMock = mArticleRepositoryMockGetByID{mock: m}
+	m.GetByIDMock.callArgs = []*ArticleRepositoryMockGetByIDParams{}
+
+	m.GetByURLMock = mArticleRepositoryMockGetByURL{mock: m}
+	m.GetByURLMock.callArgs = []*ArticleRepositoryMockGetByURLParams{}
+
+	m.GetPreviewByTagIDMock = mArticleRepositoryMockGetPreviewByTagID{mock: m}
+	m.GetPreviewByTagIDMock.callArgs = []*ArticleRepositoryMockGetPreviewByTagIDParams{}
+
+	m.UpdateMock = mArticleRepositoryMockUpdate{mock: m}
+	m.UpdateMock.callArgs = []*ArticleRepositoryMockUpdateParams{}
+
+	return m
+}
+
+type mArticleRepositoryMockAdd struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockAddExpectation
+	expectations       []*ArticleRepositoryMockAddExpectation
+
+	callArgs []*ArticleRepositoryMockAddParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockAddExpectation specifies expectation struct of the ArticleRepository.Add
+type ArticleRepositoryMockAddExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockAddParams
+	results *ArticleRepositoryMockAddResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockAddParams contains parameters of the ArticleRepository.Add
+type ArticleRepositoryMockAddParams struct {
+	ctx context.Context
+	m   models.Article
+}
+
+// ArticleRepositoryMockAddResults contains results of the ArticleRepository.Add
+type ArticleRepositoryMockAddResults struct {
+	i1  int
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.Add
+func (mmAdd *mArticleRepositoryMockAdd) Expect(ctx context.Context, m models.Article) *mArticleRepositoryMockAdd {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ArticleRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &ArticleRepositoryMockAddExpectation{}
+	}
+
+	mmAdd.defaultExpectation.params = &ArticleRepositoryMockAddParams{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 ArticleRepository.Add
+func (mmAdd *mArticleRepositoryMockAdd) Inspect(f func(ctx context.Context, m models.Article)) *mArticleRepositoryMockAdd {
+	if mmAdd.mock.inspectFuncAdd != nil {
+		mmAdd.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.Add")
+	}
+
+	mmAdd.mock.inspectFuncAdd = f
+
+	return mmAdd
+}
+
+// Return sets up results that will be returned by ArticleRepository.Add
+func (mmAdd *mArticleRepositoryMockAdd) Return(i1 int, err error) *ArticleRepositoryMock {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ArticleRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &ArticleRepositoryMockAddExpectation{mock: mmAdd.mock}
+	}
+	mmAdd.defaultExpectation.results = &ArticleRepositoryMockAddResults{i1, err}
+	return mmAdd.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.Add method
+func (mmAdd *mArticleRepositoryMockAdd) Set(f func(ctx context.Context, m models.Article) (i1 int, err error)) *ArticleRepositoryMock {
+	if mmAdd.defaultExpectation != nil {
+		mmAdd.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.Add method")
+	}
+
+	if len(mmAdd.expectations) > 0 {
+		mmAdd.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.Add method")
+	}
+
+	mmAdd.mock.funcAdd = f
+	return mmAdd.mock
+}
+
+// When sets expectation for the ArticleRepository.Add which will trigger the result defined by the following
+// Then helper
+func (mmAdd *mArticleRepositoryMockAdd) When(ctx context.Context, m models.Article) *ArticleRepositoryMockAddExpectation {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ArticleRepositoryMock.Add mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockAddExpectation{
+		mock:   mmAdd.mock,
+		params: &ArticleRepositoryMockAddParams{ctx, m},
+	}
+	mmAdd.expectations = append(mmAdd.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.Add return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockAddExpectation) Then(i1 int, err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockAddResults{i1, err}
+	return e.mock
+}
+
+// Add implements interfaces.ArticleRepository
+func (mmAdd *ArticleRepositoryMock) 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 := &ArticleRepositoryMockAddParams{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 := ArticleRepositoryMockAddParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmAdd.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.Add")
+		}
+		return (*mm_results).i1, (*mm_results).err
+	}
+	if mmAdd.funcAdd != nil {
+		return mmAdd.funcAdd(ctx, m)
+	}
+	mmAdd.t.Fatalf("Unexpected call to ArticleRepositoryMock.Add. %v %v", ctx, m)
+	return
+}
+
+// AddAfterCounter returns a count of finished ArticleRepositoryMock.Add invocations
+func (mmAdd *ArticleRepositoryMock) AddAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.afterAddCounter)
+}
+
+// AddBeforeCounter returns a count of ArticleRepositoryMock.Add invocations
+func (mmAdd *ArticleRepositoryMock) AddBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.beforeAddCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.Add.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmAdd *mArticleRepositoryMockAdd) Calls() []*ArticleRepositoryMockAddParams {
+	mmAdd.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockAddParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockAddInspect() {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.Add")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.Add")
+	}
+}
+
+type mArticleRepositoryMockDelete struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockDeleteExpectation
+	expectations       []*ArticleRepositoryMockDeleteExpectation
+
+	callArgs []*ArticleRepositoryMockDeleteParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockDeleteExpectation specifies expectation struct of the ArticleRepository.Delete
+type ArticleRepositoryMockDeleteExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockDeleteParams
+	results *ArticleRepositoryMockDeleteResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockDeleteParams contains parameters of the ArticleRepository.Delete
+type ArticleRepositoryMockDeleteParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// ArticleRepositoryMockDeleteResults contains results of the ArticleRepository.Delete
+type ArticleRepositoryMockDeleteResults struct {
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.Delete
+func (mmDelete *mArticleRepositoryMockDelete) Expect(ctx context.Context, ID int) *mArticleRepositoryMockDelete {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ArticleRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &ArticleRepositoryMockDeleteExpectation{}
+	}
+
+	mmDelete.defaultExpectation.params = &ArticleRepositoryMockDeleteParams{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 ArticleRepository.Delete
+func (mmDelete *mArticleRepositoryMockDelete) Inspect(f func(ctx context.Context, ID int)) *mArticleRepositoryMockDelete {
+	if mmDelete.mock.inspectFuncDelete != nil {
+		mmDelete.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.Delete")
+	}
+
+	mmDelete.mock.inspectFuncDelete = f
+
+	return mmDelete
+}
+
+// Return sets up results that will be returned by ArticleRepository.Delete
+func (mmDelete *mArticleRepositoryMockDelete) Return(err error) *ArticleRepositoryMock {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ArticleRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &ArticleRepositoryMockDeleteExpectation{mock: mmDelete.mock}
+	}
+	mmDelete.defaultExpectation.results = &ArticleRepositoryMockDeleteResults{err}
+	return mmDelete.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.Delete method
+func (mmDelete *mArticleRepositoryMockDelete) Set(f func(ctx context.Context, ID int) (err error)) *ArticleRepositoryMock {
+	if mmDelete.defaultExpectation != nil {
+		mmDelete.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.Delete method")
+	}
+
+	if len(mmDelete.expectations) > 0 {
+		mmDelete.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.Delete method")
+	}
+
+	mmDelete.mock.funcDelete = f
+	return mmDelete.mock
+}
+
+// When sets expectation for the ArticleRepository.Delete which will trigger the result defined by the following
+// Then helper
+func (mmDelete *mArticleRepositoryMockDelete) When(ctx context.Context, ID int) *ArticleRepositoryMockDeleteExpectation {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ArticleRepositoryMock.Delete mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockDeleteExpectation{
+		mock:   mmDelete.mock,
+		params: &ArticleRepositoryMockDeleteParams{ctx, ID},
+	}
+	mmDelete.expectations = append(mmDelete.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.Delete return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockDeleteExpectation) Then(err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockDeleteResults{err}
+	return e.mock
+}
+
+// Delete implements interfaces.ArticleRepository
+func (mmDelete *ArticleRepositoryMock) 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 := &ArticleRepositoryMockDeleteParams{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 := ArticleRepositoryMockDeleteParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDelete.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.Delete")
+		}
+		return (*mm_results).err
+	}
+	if mmDelete.funcDelete != nil {
+		return mmDelete.funcDelete(ctx, ID)
+	}
+	mmDelete.t.Fatalf("Unexpected call to ArticleRepositoryMock.Delete. %v %v", ctx, ID)
+	return
+}
+
+// DeleteAfterCounter returns a count of finished ArticleRepositoryMock.Delete invocations
+func (mmDelete *ArticleRepositoryMock) DeleteAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.afterDeleteCounter)
+}
+
+// DeleteBeforeCounter returns a count of ArticleRepositoryMock.Delete invocations
+func (mmDelete *ArticleRepositoryMock) DeleteBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.beforeDeleteCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.Delete.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDelete *mArticleRepositoryMockDelete) Calls() []*ArticleRepositoryMockDeleteParams {
+	mmDelete.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockDeleteParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockDeleteInspect() {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.Delete")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.Delete")
+	}
+}
+
+type mArticleRepositoryMockGetAll struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockGetAllExpectation
+	expectations       []*ArticleRepositoryMockGetAllExpectation
+
+	callArgs []*ArticleRepositoryMockGetAllParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockGetAllExpectation specifies expectation struct of the ArticleRepository.GetAll
+type ArticleRepositoryMockGetAllExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockGetAllParams
+	results *ArticleRepositoryMockGetAllResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockGetAllParams contains parameters of the ArticleRepository.GetAll
+type ArticleRepositoryMockGetAllParams struct {
+	ctx context.Context
+}
+
+// ArticleRepositoryMockGetAllResults contains results of the ArticleRepository.GetAll
+type ArticleRepositoryMockGetAllResults struct {
+	aa1 []models.Article
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.GetAll
+func (mmGetAll *mArticleRepositoryMockGetAll) Expect(ctx context.Context) *mArticleRepositoryMockGetAll {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("ArticleRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &ArticleRepositoryMockGetAllExpectation{}
+	}
+
+	mmGetAll.defaultExpectation.params = &ArticleRepositoryMockGetAllParams{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 ArticleRepository.GetAll
+func (mmGetAll *mArticleRepositoryMockGetAll) Inspect(f func(ctx context.Context)) *mArticleRepositoryMockGetAll {
+	if mmGetAll.mock.inspectFuncGetAll != nil {
+		mmGetAll.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.GetAll")
+	}
+
+	mmGetAll.mock.inspectFuncGetAll = f
+
+	return mmGetAll
+}
+
+// Return sets up results that will be returned by ArticleRepository.GetAll
+func (mmGetAll *mArticleRepositoryMockGetAll) Return(aa1 []models.Article, err error) *ArticleRepositoryMock {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("ArticleRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &ArticleRepositoryMockGetAllExpectation{mock: mmGetAll.mock}
+	}
+	mmGetAll.defaultExpectation.results = &ArticleRepositoryMockGetAllResults{aa1, err}
+	return mmGetAll.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.GetAll method
+func (mmGetAll *mArticleRepositoryMockGetAll) Set(f func(ctx context.Context) (aa1 []models.Article, err error)) *ArticleRepositoryMock {
+	if mmGetAll.defaultExpectation != nil {
+		mmGetAll.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.GetAll method")
+	}
+
+	if len(mmGetAll.expectations) > 0 {
+		mmGetAll.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.GetAll method")
+	}
+
+	mmGetAll.mock.funcGetAll = f
+	return mmGetAll.mock
+}
+
+// When sets expectation for the ArticleRepository.GetAll which will trigger the result defined by the following
+// Then helper
+func (mmGetAll *mArticleRepositoryMockGetAll) When(ctx context.Context) *ArticleRepositoryMockGetAllExpectation {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("ArticleRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockGetAllExpectation{
+		mock:   mmGetAll.mock,
+		params: &ArticleRepositoryMockGetAllParams{ctx},
+	}
+	mmGetAll.expectations = append(mmGetAll.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.GetAll return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockGetAllExpectation) Then(aa1 []models.Article, err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockGetAllResults{aa1, err}
+	return e.mock
+}
+
+// GetAll implements interfaces.ArticleRepository
+func (mmGetAll *ArticleRepositoryMock) 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 := &ArticleRepositoryMockGetAllParams{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 := ArticleRepositoryMockGetAllParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAll.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.GetAll")
+		}
+		return (*mm_results).aa1, (*mm_results).err
+	}
+	if mmGetAll.funcGetAll != nil {
+		return mmGetAll.funcGetAll(ctx)
+	}
+	mmGetAll.t.Fatalf("Unexpected call to ArticleRepositoryMock.GetAll. %v", ctx)
+	return
+}
+
+// GetAllAfterCounter returns a count of finished ArticleRepositoryMock.GetAll invocations
+func (mmGetAll *ArticleRepositoryMock) GetAllAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.afterGetAllCounter)
+}
+
+// GetAllBeforeCounter returns a count of ArticleRepositoryMock.GetAll invocations
+func (mmGetAll *ArticleRepositoryMock) GetAllBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.beforeGetAllCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.GetAll.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAll *mArticleRepositoryMockGetAll) Calls() []*ArticleRepositoryMockGetAllParams {
+	mmGetAll.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockGetAllParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockGetAllInspect() {
+	for _, e := range m.GetAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetAll")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetAll")
+	}
+}
+
+type mArticleRepositoryMockGetAllPreview struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockGetAllPreviewExpectation
+	expectations       []*ArticleRepositoryMockGetAllPreviewExpectation
+
+	callArgs []*ArticleRepositoryMockGetAllPreviewParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockGetAllPreviewExpectation specifies expectation struct of the ArticleRepository.GetAllPreview
+type ArticleRepositoryMockGetAllPreviewExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockGetAllPreviewParams
+	results *ArticleRepositoryMockGetAllPreviewResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockGetAllPreviewParams contains parameters of the ArticleRepository.GetAllPreview
+type ArticleRepositoryMockGetAllPreviewParams struct {
+	ctx context.Context
+}
+
+// ArticleRepositoryMockGetAllPreviewResults contains results of the ArticleRepository.GetAllPreview
+type ArticleRepositoryMockGetAllPreviewResults struct {
+	aa1 []models.ArticlePreview
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.GetAllPreview
+func (mmGetAllPreview *mArticleRepositoryMockGetAllPreview) Expect(ctx context.Context) *mArticleRepositoryMockGetAllPreview {
+	if mmGetAllPreview.mock.funcGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("ArticleRepositoryMock.GetAllPreview mock is already set by Set")
+	}
+
+	if mmGetAllPreview.defaultExpectation == nil {
+		mmGetAllPreview.defaultExpectation = &ArticleRepositoryMockGetAllPreviewExpectation{}
+	}
+
+	mmGetAllPreview.defaultExpectation.params = &ArticleRepositoryMockGetAllPreviewParams{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 ArticleRepository.GetAllPreview
+func (mmGetAllPreview *mArticleRepositoryMockGetAllPreview) Inspect(f func(ctx context.Context)) *mArticleRepositoryMockGetAllPreview {
+	if mmGetAllPreview.mock.inspectFuncGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.GetAllPreview")
+	}
+
+	mmGetAllPreview.mock.inspectFuncGetAllPreview = f
+
+	return mmGetAllPreview
+}
+
+// Return sets up results that will be returned by ArticleRepository.GetAllPreview
+func (mmGetAllPreview *mArticleRepositoryMockGetAllPreview) Return(aa1 []models.ArticlePreview, err error) *ArticleRepositoryMock {
+	if mmGetAllPreview.mock.funcGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("ArticleRepositoryMock.GetAllPreview mock is already set by Set")
+	}
+
+	if mmGetAllPreview.defaultExpectation == nil {
+		mmGetAllPreview.defaultExpectation = &ArticleRepositoryMockGetAllPreviewExpectation{mock: mmGetAllPreview.mock}
+	}
+	mmGetAllPreview.defaultExpectation.results = &ArticleRepositoryMockGetAllPreviewResults{aa1, err}
+	return mmGetAllPreview.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.GetAllPreview method
+func (mmGetAllPreview *mArticleRepositoryMockGetAllPreview) Set(f func(ctx context.Context) (aa1 []models.ArticlePreview, err error)) *ArticleRepositoryMock {
+	if mmGetAllPreview.defaultExpectation != nil {
+		mmGetAllPreview.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.GetAllPreview method")
+	}
+
+	if len(mmGetAllPreview.expectations) > 0 {
+		mmGetAllPreview.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.GetAllPreview method")
+	}
+
+	mmGetAllPreview.mock.funcGetAllPreview = f
+	return mmGetAllPreview.mock
+}
+
+// When sets expectation for the ArticleRepository.GetAllPreview which will trigger the result defined by the following
+// Then helper
+func (mmGetAllPreview *mArticleRepositoryMockGetAllPreview) When(ctx context.Context) *ArticleRepositoryMockGetAllPreviewExpectation {
+	if mmGetAllPreview.mock.funcGetAllPreview != nil {
+		mmGetAllPreview.mock.t.Fatalf("ArticleRepositoryMock.GetAllPreview mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockGetAllPreviewExpectation{
+		mock:   mmGetAllPreview.mock,
+		params: &ArticleRepositoryMockGetAllPreviewParams{ctx},
+	}
+	mmGetAllPreview.expectations = append(mmGetAllPreview.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.GetAllPreview return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockGetAllPreviewExpectation) Then(aa1 []models.ArticlePreview, err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockGetAllPreviewResults{aa1, err}
+	return e.mock
+}
+
+// GetAllPreview implements interfaces.ArticleRepository
+func (mmGetAllPreview *ArticleRepositoryMock) 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 := &ArticleRepositoryMockGetAllPreviewParams{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 := ArticleRepositoryMockGetAllPreviewParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAllPreview.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.GetAllPreview")
+		}
+		return (*mm_results).aa1, (*mm_results).err
+	}
+	if mmGetAllPreview.funcGetAllPreview != nil {
+		return mmGetAllPreview.funcGetAllPreview(ctx)
+	}
+	mmGetAllPreview.t.Fatalf("Unexpected call to ArticleRepositoryMock.GetAllPreview. %v", ctx)
+	return
+}
+
+// GetAllPreviewAfterCounter returns a count of finished ArticleRepositoryMock.GetAllPreview invocations
+func (mmGetAllPreview *ArticleRepositoryMock) GetAllPreviewAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllPreview.afterGetAllPreviewCounter)
+}
+
+// GetAllPreviewBeforeCounter returns a count of ArticleRepositoryMock.GetAllPreview invocations
+func (mmGetAllPreview *ArticleRepositoryMock) GetAllPreviewBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllPreview.beforeGetAllPreviewCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.GetAllPreview.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAllPreview *mArticleRepositoryMockGetAllPreview) Calls() []*ArticleRepositoryMockGetAllPreviewParams {
+	mmGetAllPreview.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockGetAllPreviewParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockGetAllPreviewInspect() {
+	for _, e := range m.GetAllPreviewMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetAllPreview")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetAllPreview")
+	}
+}
+
+type mArticleRepositoryMockGetByID struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockGetByIDExpectation
+	expectations       []*ArticleRepositoryMockGetByIDExpectation
+
+	callArgs []*ArticleRepositoryMockGetByIDParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockGetByIDExpectation specifies expectation struct of the ArticleRepository.GetByID
+type ArticleRepositoryMockGetByIDExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockGetByIDParams
+	results *ArticleRepositoryMockGetByIDResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockGetByIDParams contains parameters of the ArticleRepository.GetByID
+type ArticleRepositoryMockGetByIDParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// ArticleRepositoryMockGetByIDResults contains results of the ArticleRepository.GetByID
+type ArticleRepositoryMockGetByIDResults struct {
+	ap1 *models.Article
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.GetByID
+func (mmGetByID *mArticleRepositoryMockGetByID) Expect(ctx context.Context, ID int) *mArticleRepositoryMockGetByID {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("ArticleRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &ArticleRepositoryMockGetByIDExpectation{}
+	}
+
+	mmGetByID.defaultExpectation.params = &ArticleRepositoryMockGetByIDParams{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 ArticleRepository.GetByID
+func (mmGetByID *mArticleRepositoryMockGetByID) Inspect(f func(ctx context.Context, ID int)) *mArticleRepositoryMockGetByID {
+	if mmGetByID.mock.inspectFuncGetByID != nil {
+		mmGetByID.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.GetByID")
+	}
+
+	mmGetByID.mock.inspectFuncGetByID = f
+
+	return mmGetByID
+}
+
+// Return sets up results that will be returned by ArticleRepository.GetByID
+func (mmGetByID *mArticleRepositoryMockGetByID) Return(ap1 *models.Article, err error) *ArticleRepositoryMock {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("ArticleRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &ArticleRepositoryMockGetByIDExpectation{mock: mmGetByID.mock}
+	}
+	mmGetByID.defaultExpectation.results = &ArticleRepositoryMockGetByIDResults{ap1, err}
+	return mmGetByID.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.GetByID method
+func (mmGetByID *mArticleRepositoryMockGetByID) Set(f func(ctx context.Context, ID int) (ap1 *models.Article, err error)) *ArticleRepositoryMock {
+	if mmGetByID.defaultExpectation != nil {
+		mmGetByID.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.GetByID method")
+	}
+
+	if len(mmGetByID.expectations) > 0 {
+		mmGetByID.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.GetByID method")
+	}
+
+	mmGetByID.mock.funcGetByID = f
+	return mmGetByID.mock
+}
+
+// When sets expectation for the ArticleRepository.GetByID which will trigger the result defined by the following
+// Then helper
+func (mmGetByID *mArticleRepositoryMockGetByID) When(ctx context.Context, ID int) *ArticleRepositoryMockGetByIDExpectation {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("ArticleRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockGetByIDExpectation{
+		mock:   mmGetByID.mock,
+		params: &ArticleRepositoryMockGetByIDParams{ctx, ID},
+	}
+	mmGetByID.expectations = append(mmGetByID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.GetByID return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockGetByIDExpectation) Then(ap1 *models.Article, err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockGetByIDResults{ap1, err}
+	return e.mock
+}
+
+// GetByID implements interfaces.ArticleRepository
+func (mmGetByID *ArticleRepositoryMock) 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 := &ArticleRepositoryMockGetByIDParams{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 := ArticleRepositoryMockGetByIDParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByID.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.GetByID")
+		}
+		return (*mm_results).ap1, (*mm_results).err
+	}
+	if mmGetByID.funcGetByID != nil {
+		return mmGetByID.funcGetByID(ctx, ID)
+	}
+	mmGetByID.t.Fatalf("Unexpected call to ArticleRepositoryMock.GetByID. %v %v", ctx, ID)
+	return
+}
+
+// GetByIDAfterCounter returns a count of finished ArticleRepositoryMock.GetByID invocations
+func (mmGetByID *ArticleRepositoryMock) GetByIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.afterGetByIDCounter)
+}
+
+// GetByIDBeforeCounter returns a count of ArticleRepositoryMock.GetByID invocations
+func (mmGetByID *ArticleRepositoryMock) GetByIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.beforeGetByIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.GetByID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByID *mArticleRepositoryMockGetByID) Calls() []*ArticleRepositoryMockGetByIDParams {
+	mmGetByID.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockGetByIDParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockGetByIDInspect() {
+	for _, e := range m.GetByIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetByID")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetByID")
+	}
+}
+
+type mArticleRepositoryMockGetByURL struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockGetByURLExpectation
+	expectations       []*ArticleRepositoryMockGetByURLExpectation
+
+	callArgs []*ArticleRepositoryMockGetByURLParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockGetByURLExpectation specifies expectation struct of the ArticleRepository.GetByURL
+type ArticleRepositoryMockGetByURLExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockGetByURLParams
+	results *ArticleRepositoryMockGetByURLResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockGetByURLParams contains parameters of the ArticleRepository.GetByURL
+type ArticleRepositoryMockGetByURLParams struct {
+	ctx context.Context
+	url string
+}
+
+// ArticleRepositoryMockGetByURLResults contains results of the ArticleRepository.GetByURL
+type ArticleRepositoryMockGetByURLResults struct {
+	ap1 *models.Article
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.GetByURL
+func (mmGetByURL *mArticleRepositoryMockGetByURL) Expect(ctx context.Context, url string) *mArticleRepositoryMockGetByURL {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("ArticleRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &ArticleRepositoryMockGetByURLExpectation{}
+	}
+
+	mmGetByURL.defaultExpectation.params = &ArticleRepositoryMockGetByURLParams{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 ArticleRepository.GetByURL
+func (mmGetByURL *mArticleRepositoryMockGetByURL) Inspect(f func(ctx context.Context, url string)) *mArticleRepositoryMockGetByURL {
+	if mmGetByURL.mock.inspectFuncGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.GetByURL")
+	}
+
+	mmGetByURL.mock.inspectFuncGetByURL = f
+
+	return mmGetByURL
+}
+
+// Return sets up results that will be returned by ArticleRepository.GetByURL
+func (mmGetByURL *mArticleRepositoryMockGetByURL) Return(ap1 *models.Article, err error) *ArticleRepositoryMock {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("ArticleRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &ArticleRepositoryMockGetByURLExpectation{mock: mmGetByURL.mock}
+	}
+	mmGetByURL.defaultExpectation.results = &ArticleRepositoryMockGetByURLResults{ap1, err}
+	return mmGetByURL.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.GetByURL method
+func (mmGetByURL *mArticleRepositoryMockGetByURL) Set(f func(ctx context.Context, url string) (ap1 *models.Article, err error)) *ArticleRepositoryMock {
+	if mmGetByURL.defaultExpectation != nil {
+		mmGetByURL.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.GetByURL method")
+	}
+
+	if len(mmGetByURL.expectations) > 0 {
+		mmGetByURL.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.GetByURL method")
+	}
+
+	mmGetByURL.mock.funcGetByURL = f
+	return mmGetByURL.mock
+}
+
+// When sets expectation for the ArticleRepository.GetByURL which will trigger the result defined by the following
+// Then helper
+func (mmGetByURL *mArticleRepositoryMockGetByURL) When(ctx context.Context, url string) *ArticleRepositoryMockGetByURLExpectation {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("ArticleRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockGetByURLExpectation{
+		mock:   mmGetByURL.mock,
+		params: &ArticleRepositoryMockGetByURLParams{ctx, url},
+	}
+	mmGetByURL.expectations = append(mmGetByURL.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.GetByURL return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockGetByURLExpectation) Then(ap1 *models.Article, err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockGetByURLResults{ap1, err}
+	return e.mock
+}
+
+// GetByURL implements interfaces.ArticleRepository
+func (mmGetByURL *ArticleRepositoryMock) 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 := &ArticleRepositoryMockGetByURLParams{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 := ArticleRepositoryMockGetByURLParams{ctx, url}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByURL.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.GetByURL")
+		}
+		return (*mm_results).ap1, (*mm_results).err
+	}
+	if mmGetByURL.funcGetByURL != nil {
+		return mmGetByURL.funcGetByURL(ctx, url)
+	}
+	mmGetByURL.t.Fatalf("Unexpected call to ArticleRepositoryMock.GetByURL. %v %v", ctx, url)
+	return
+}
+
+// GetByURLAfterCounter returns a count of finished ArticleRepositoryMock.GetByURL invocations
+func (mmGetByURL *ArticleRepositoryMock) GetByURLAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.afterGetByURLCounter)
+}
+
+// GetByURLBeforeCounter returns a count of ArticleRepositoryMock.GetByURL invocations
+func (mmGetByURL *ArticleRepositoryMock) GetByURLBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.beforeGetByURLCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.GetByURL.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByURL *mArticleRepositoryMockGetByURL) Calls() []*ArticleRepositoryMockGetByURLParams {
+	mmGetByURL.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockGetByURLParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockGetByURLInspect() {
+	for _, e := range m.GetByURLMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetByURL")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetByURL")
+	}
+}
+
+type mArticleRepositoryMockGetPreviewByTagID struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockGetPreviewByTagIDExpectation
+	expectations       []*ArticleRepositoryMockGetPreviewByTagIDExpectation
+
+	callArgs []*ArticleRepositoryMockGetPreviewByTagIDParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockGetPreviewByTagIDExpectation specifies expectation struct of the ArticleRepository.GetPreviewByTagID
+type ArticleRepositoryMockGetPreviewByTagIDExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockGetPreviewByTagIDParams
+	results *ArticleRepositoryMockGetPreviewByTagIDResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockGetPreviewByTagIDParams contains parameters of the ArticleRepository.GetPreviewByTagID
+type ArticleRepositoryMockGetPreviewByTagIDParams struct {
+	ctx   context.Context
+	tagID int
+}
+
+// ArticleRepositoryMockGetPreviewByTagIDResults contains results of the ArticleRepository.GetPreviewByTagID
+type ArticleRepositoryMockGetPreviewByTagIDResults struct {
+	aa1 []models.ArticlePreview
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.GetPreviewByTagID
+func (mmGetPreviewByTagID *mArticleRepositoryMockGetPreviewByTagID) Expect(ctx context.Context, tagID int) *mArticleRepositoryMockGetPreviewByTagID {
+	if mmGetPreviewByTagID.mock.funcGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("ArticleRepositoryMock.GetPreviewByTagID mock is already set by Set")
+	}
+
+	if mmGetPreviewByTagID.defaultExpectation == nil {
+		mmGetPreviewByTagID.defaultExpectation = &ArticleRepositoryMockGetPreviewByTagIDExpectation{}
+	}
+
+	mmGetPreviewByTagID.defaultExpectation.params = &ArticleRepositoryMockGetPreviewByTagIDParams{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 ArticleRepository.GetPreviewByTagID
+func (mmGetPreviewByTagID *mArticleRepositoryMockGetPreviewByTagID) Inspect(f func(ctx context.Context, tagID int)) *mArticleRepositoryMockGetPreviewByTagID {
+	if mmGetPreviewByTagID.mock.inspectFuncGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.GetPreviewByTagID")
+	}
+
+	mmGetPreviewByTagID.mock.inspectFuncGetPreviewByTagID = f
+
+	return mmGetPreviewByTagID
+}
+
+// Return sets up results that will be returned by ArticleRepository.GetPreviewByTagID
+func (mmGetPreviewByTagID *mArticleRepositoryMockGetPreviewByTagID) Return(aa1 []models.ArticlePreview, err error) *ArticleRepositoryMock {
+	if mmGetPreviewByTagID.mock.funcGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("ArticleRepositoryMock.GetPreviewByTagID mock is already set by Set")
+	}
+
+	if mmGetPreviewByTagID.defaultExpectation == nil {
+		mmGetPreviewByTagID.defaultExpectation = &ArticleRepositoryMockGetPreviewByTagIDExpectation{mock: mmGetPreviewByTagID.mock}
+	}
+	mmGetPreviewByTagID.defaultExpectation.results = &ArticleRepositoryMockGetPreviewByTagIDResults{aa1, err}
+	return mmGetPreviewByTagID.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.GetPreviewByTagID method
+func (mmGetPreviewByTagID *mArticleRepositoryMockGetPreviewByTagID) Set(f func(ctx context.Context, tagID int) (aa1 []models.ArticlePreview, err error)) *ArticleRepositoryMock {
+	if mmGetPreviewByTagID.defaultExpectation != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.GetPreviewByTagID method")
+	}
+
+	if len(mmGetPreviewByTagID.expectations) > 0 {
+		mmGetPreviewByTagID.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.GetPreviewByTagID method")
+	}
+
+	mmGetPreviewByTagID.mock.funcGetPreviewByTagID = f
+	return mmGetPreviewByTagID.mock
+}
+
+// When sets expectation for the ArticleRepository.GetPreviewByTagID which will trigger the result defined by the following
+// Then helper
+func (mmGetPreviewByTagID *mArticleRepositoryMockGetPreviewByTagID) When(ctx context.Context, tagID int) *ArticleRepositoryMockGetPreviewByTagIDExpectation {
+	if mmGetPreviewByTagID.mock.funcGetPreviewByTagID != nil {
+		mmGetPreviewByTagID.mock.t.Fatalf("ArticleRepositoryMock.GetPreviewByTagID mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockGetPreviewByTagIDExpectation{
+		mock:   mmGetPreviewByTagID.mock,
+		params: &ArticleRepositoryMockGetPreviewByTagIDParams{ctx, tagID},
+	}
+	mmGetPreviewByTagID.expectations = append(mmGetPreviewByTagID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.GetPreviewByTagID return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockGetPreviewByTagIDExpectation) Then(aa1 []models.ArticlePreview, err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockGetPreviewByTagIDResults{aa1, err}
+	return e.mock
+}
+
+// GetPreviewByTagID implements interfaces.ArticleRepository
+func (mmGetPreviewByTagID *ArticleRepositoryMock) 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 := &ArticleRepositoryMockGetPreviewByTagIDParams{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 := ArticleRepositoryMockGetPreviewByTagIDParams{ctx, tagID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetPreviewByTagID.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.GetPreviewByTagID")
+		}
+		return (*mm_results).aa1, (*mm_results).err
+	}
+	if mmGetPreviewByTagID.funcGetPreviewByTagID != nil {
+		return mmGetPreviewByTagID.funcGetPreviewByTagID(ctx, tagID)
+	}
+	mmGetPreviewByTagID.t.Fatalf("Unexpected call to ArticleRepositoryMock.GetPreviewByTagID. %v %v", ctx, tagID)
+	return
+}
+
+// GetPreviewByTagIDAfterCounter returns a count of finished ArticleRepositoryMock.GetPreviewByTagID invocations
+func (mmGetPreviewByTagID *ArticleRepositoryMock) GetPreviewByTagIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetPreviewByTagID.afterGetPreviewByTagIDCounter)
+}
+
+// GetPreviewByTagIDBeforeCounter returns a count of ArticleRepositoryMock.GetPreviewByTagID invocations
+func (mmGetPreviewByTagID *ArticleRepositoryMock) GetPreviewByTagIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetPreviewByTagID.beforeGetPreviewByTagIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.GetPreviewByTagID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetPreviewByTagID *mArticleRepositoryMockGetPreviewByTagID) Calls() []*ArticleRepositoryMockGetPreviewByTagIDParams {
+	mmGetPreviewByTagID.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockGetPreviewByTagIDParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockGetPreviewByTagIDInspect() {
+	for _, e := range m.GetPreviewByTagIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetPreviewByTagID")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.GetPreviewByTagID")
+	}
+}
+
+type mArticleRepositoryMockUpdate struct {
+	mock               *ArticleRepositoryMock
+	defaultExpectation *ArticleRepositoryMockUpdateExpectation
+	expectations       []*ArticleRepositoryMockUpdateExpectation
+
+	callArgs []*ArticleRepositoryMockUpdateParams
+	mutex    sync.RWMutex
+}
+
+// ArticleRepositoryMockUpdateExpectation specifies expectation struct of the ArticleRepository.Update
+type ArticleRepositoryMockUpdateExpectation struct {
+	mock    *ArticleRepositoryMock
+	params  *ArticleRepositoryMockUpdateParams
+	results *ArticleRepositoryMockUpdateResults
+	Counter uint64
+}
+
+// ArticleRepositoryMockUpdateParams contains parameters of the ArticleRepository.Update
+type ArticleRepositoryMockUpdateParams struct {
+	ctx context.Context
+	m   models.Article
+}
+
+// ArticleRepositoryMockUpdateResults contains results of the ArticleRepository.Update
+type ArticleRepositoryMockUpdateResults struct {
+	err error
+}
+
+// Expect sets up expected params for ArticleRepository.Update
+func (mmUpdate *mArticleRepositoryMockUpdate) Expect(ctx context.Context, m models.Article) *mArticleRepositoryMockUpdate {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("ArticleRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &ArticleRepositoryMockUpdateExpectation{}
+	}
+
+	mmUpdate.defaultExpectation.params = &ArticleRepositoryMockUpdateParams{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 ArticleRepository.Update
+func (mmUpdate *mArticleRepositoryMockUpdate) Inspect(f func(ctx context.Context, m models.Article)) *mArticleRepositoryMockUpdate {
+	if mmUpdate.mock.inspectFuncUpdate != nil {
+		mmUpdate.mock.t.Fatalf("Inspect function is already set for ArticleRepositoryMock.Update")
+	}
+
+	mmUpdate.mock.inspectFuncUpdate = f
+
+	return mmUpdate
+}
+
+// Return sets up results that will be returned by ArticleRepository.Update
+func (mmUpdate *mArticleRepositoryMockUpdate) Return(err error) *ArticleRepositoryMock {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("ArticleRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &ArticleRepositoryMockUpdateExpectation{mock: mmUpdate.mock}
+	}
+	mmUpdate.defaultExpectation.results = &ArticleRepositoryMockUpdateResults{err}
+	return mmUpdate.mock
+}
+
+// Set uses given function f to mock the ArticleRepository.Update method
+func (mmUpdate *mArticleRepositoryMockUpdate) Set(f func(ctx context.Context, m models.Article) (err error)) *ArticleRepositoryMock {
+	if mmUpdate.defaultExpectation != nil {
+		mmUpdate.mock.t.Fatalf("Default expectation is already set for the ArticleRepository.Update method")
+	}
+
+	if len(mmUpdate.expectations) > 0 {
+		mmUpdate.mock.t.Fatalf("Some expectations are already set for the ArticleRepository.Update method")
+	}
+
+	mmUpdate.mock.funcUpdate = f
+	return mmUpdate.mock
+}
+
+// When sets expectation for the ArticleRepository.Update which will trigger the result defined by the following
+// Then helper
+func (mmUpdate *mArticleRepositoryMockUpdate) When(ctx context.Context, m models.Article) *ArticleRepositoryMockUpdateExpectation {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("ArticleRepositoryMock.Update mock is already set by Set")
+	}
+
+	expectation := &ArticleRepositoryMockUpdateExpectation{
+		mock:   mmUpdate.mock,
+		params: &ArticleRepositoryMockUpdateParams{ctx, m},
+	}
+	mmUpdate.expectations = append(mmUpdate.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleRepository.Update return parameters for the expectation previously defined by the When method
+func (e *ArticleRepositoryMockUpdateExpectation) Then(err error) *ArticleRepositoryMock {
+	e.results = &ArticleRepositoryMockUpdateResults{err}
+	return e.mock
+}
+
+// Update implements interfaces.ArticleRepository
+func (mmUpdate *ArticleRepositoryMock) 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 := &ArticleRepositoryMockUpdateParams{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 := ArticleRepositoryMockUpdateParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmUpdate.t.Errorf("ArticleRepositoryMock.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 ArticleRepositoryMock.Update")
+		}
+		return (*mm_results).err
+	}
+	if mmUpdate.funcUpdate != nil {
+		return mmUpdate.funcUpdate(ctx, m)
+	}
+	mmUpdate.t.Fatalf("Unexpected call to ArticleRepositoryMock.Update. %v %v", ctx, m)
+	return
+}
+
+// UpdateAfterCounter returns a count of finished ArticleRepositoryMock.Update invocations
+func (mmUpdate *ArticleRepositoryMock) UpdateAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.afterUpdateCounter)
+}
+
+// UpdateBeforeCounter returns a count of ArticleRepositoryMock.Update invocations
+func (mmUpdate *ArticleRepositoryMock) UpdateBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.beforeUpdateCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleRepositoryMock.Update.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmUpdate *mArticleRepositoryMockUpdate) Calls() []*ArticleRepositoryMockUpdateParams {
+	mmUpdate.mutex.RLock()
+
+	argCopy := make([]*ArticleRepositoryMockUpdateParams, 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) MinimockUpdateInspect() {
+	for _, e := range m.UpdateMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.Update")
+		} else {
+			m.t.Errorf("Expected call to ArticleRepositoryMock.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 ArticleRepositoryMock.Update")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *ArticleRepositoryMock) 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 *ArticleRepositoryMock) 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 *ArticleRepositoryMock) 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/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.ArticleTagRepository -o ./mocks/article_tag_repository_minimock.go -n ArticleTagRepositoryMock
+
+import (
+	"context"
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/gojuno/minimock/v3"
+)
+
+// ArticleTagRepositoryMock implements interfaces.ArticleTagRepository
+type ArticleTagRepositoryMock 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          mArticleTagRepositoryMockAdd
+
+	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          mArticleTagRepositoryMockDelete
+
+	funcDeleteByArticleID          func(ctx context.Context, articleID int) (err error)
+	inspectFuncDeleteByArticleID   func(ctx context.Context, articleID int)
+	afterDeleteByArticleIDCounter  uint64
+	beforeDeleteByArticleIDCounter uint64
+	DeleteByArticleIDMock          mArticleTagRepositoryMockDeleteByArticleID
+}
+
+// NewArticleTagRepositoryMock returns a mock for interfaces.ArticleTagRepository
+func NewArticleTagRepositoryMock(t minimock.Tester) *ArticleTagRepositoryMock {
+	m := &ArticleTagRepositoryMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.AddMock = mArticleTagRepositoryMockAdd{mock: m}
+	m.AddMock.callArgs = []*ArticleTagRepositoryMockAddParams{}
+
+	m.DeleteMock = mArticleTagRepositoryMockDelete{mock: m}
+	m.DeleteMock.callArgs = []*ArticleTagRepositoryMockDeleteParams{}
+
+	m.DeleteByArticleIDMock = mArticleTagRepositoryMockDeleteByArticleID{mock: m}
+	m.DeleteByArticleIDMock.callArgs = []*ArticleTagRepositoryMockDeleteByArticleIDParams{}
+
+	return m
+}
+
+type mArticleTagRepositoryMockAdd struct {
+	mock               *ArticleTagRepositoryMock
+	defaultExpectation *ArticleTagRepositoryMockAddExpectation
+	expectations       []*ArticleTagRepositoryMockAddExpectation
+
+	callArgs []*ArticleTagRepositoryMockAddParams
+	mutex    sync.RWMutex
+}
+
+// ArticleTagRepositoryMockAddExpectation specifies expectation struct of the ArticleTagRepository.Add
+type ArticleTagRepositoryMockAddExpectation struct {
+	mock    *ArticleTagRepositoryMock
+	params  *ArticleTagRepositoryMockAddParams
+	results *ArticleTagRepositoryMockAddResults
+	Counter uint64
+}
+
+// ArticleTagRepositoryMockAddParams contains parameters of the ArticleTagRepository.Add
+type ArticleTagRepositoryMockAddParams struct {
+	ctx       context.Context
+	articleID int
+	tagIDs    []int
+}
+
+// ArticleTagRepositoryMockAddResults contains results of the ArticleTagRepository.Add
+type ArticleTagRepositoryMockAddResults struct {
+	err error
+}
+
+// Expect sets up expected params for ArticleTagRepository.Add
+func (mmAdd *mArticleTagRepositoryMockAdd) Expect(ctx context.Context, articleID int, tagIDs []int) *mArticleTagRepositoryMockAdd {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ArticleTagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &ArticleTagRepositoryMockAddExpectation{}
+	}
+
+	mmAdd.defaultExpectation.params = &ArticleTagRepositoryMockAddParams{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 ArticleTagRepository.Add
+func (mmAdd *mArticleTagRepositoryMockAdd) Inspect(f func(ctx context.Context, articleID int, tagIDs []int)) *mArticleTagRepositoryMockAdd {
+	if mmAdd.mock.inspectFuncAdd != nil {
+		mmAdd.mock.t.Fatalf("Inspect function is already set for ArticleTagRepositoryMock.Add")
+	}
+
+	mmAdd.mock.inspectFuncAdd = f
+
+	return mmAdd
+}
+
+// Return sets up results that will be returned by ArticleTagRepository.Add
+func (mmAdd *mArticleTagRepositoryMockAdd) Return(err error) *ArticleTagRepositoryMock {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ArticleTagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &ArticleTagRepositoryMockAddExpectation{mock: mmAdd.mock}
+	}
+	mmAdd.defaultExpectation.results = &ArticleTagRepositoryMockAddResults{err}
+	return mmAdd.mock
+}
+
+// Set uses given function f to mock the ArticleTagRepository.Add method
+func (mmAdd *mArticleTagRepositoryMockAdd) Set(f func(ctx context.Context, articleID int, tagIDs []int) (err error)) *ArticleTagRepositoryMock {
+	if mmAdd.defaultExpectation != nil {
+		mmAdd.mock.t.Fatalf("Default expectation is already set for the ArticleTagRepository.Add method")
+	}
+
+	if len(mmAdd.expectations) > 0 {
+		mmAdd.mock.t.Fatalf("Some expectations are already set for the ArticleTagRepository.Add method")
+	}
+
+	mmAdd.mock.funcAdd = f
+	return mmAdd.mock
+}
+
+// When sets expectation for the ArticleTagRepository.Add which will trigger the result defined by the following
+// Then helper
+func (mmAdd *mArticleTagRepositoryMockAdd) When(ctx context.Context, articleID int, tagIDs []int) *ArticleTagRepositoryMockAddExpectation {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("ArticleTagRepositoryMock.Add mock is already set by Set")
+	}
+
+	expectation := &ArticleTagRepositoryMockAddExpectation{
+		mock:   mmAdd.mock,
+		params: &ArticleTagRepositoryMockAddParams{ctx, articleID, tagIDs},
+	}
+	mmAdd.expectations = append(mmAdd.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleTagRepository.Add return parameters for the expectation previously defined by the When method
+func (e *ArticleTagRepositoryMockAddExpectation) Then(err error) *ArticleTagRepositoryMock {
+	e.results = &ArticleTagRepositoryMockAddResults{err}
+	return e.mock
+}
+
+// Add implements interfaces.ArticleTagRepository
+func (mmAdd *ArticleTagRepositoryMock) 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 := &ArticleTagRepositoryMockAddParams{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 := ArticleTagRepositoryMockAddParams{ctx, articleID, tagIDs}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmAdd.t.Errorf("ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.Add")
+		}
+		return (*mm_results).err
+	}
+	if mmAdd.funcAdd != nil {
+		return mmAdd.funcAdd(ctx, articleID, tagIDs)
+	}
+	mmAdd.t.Fatalf("Unexpected call to ArticleTagRepositoryMock.Add. %v %v %v", ctx, articleID, tagIDs)
+	return
+}
+
+// AddAfterCounter returns a count of finished ArticleTagRepositoryMock.Add invocations
+func (mmAdd *ArticleTagRepositoryMock) AddAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.afterAddCounter)
+}
+
+// AddBeforeCounter returns a count of ArticleTagRepositoryMock.Add invocations
+func (mmAdd *ArticleTagRepositoryMock) AddBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.beforeAddCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleTagRepositoryMock.Add.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmAdd *mArticleTagRepositoryMockAdd) Calls() []*ArticleTagRepositoryMockAddParams {
+	mmAdd.mutex.RLock()
+
+	argCopy := make([]*ArticleTagRepositoryMockAddParams, 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 *ArticleTagRepositoryMock) 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 *ArticleTagRepositoryMock) MinimockAddInspect() {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.Add")
+		} else {
+			m.t.Errorf("Expected call to ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.Add")
+	}
+}
+
+type mArticleTagRepositoryMockDelete struct {
+	mock               *ArticleTagRepositoryMock
+	defaultExpectation *ArticleTagRepositoryMockDeleteExpectation
+	expectations       []*ArticleTagRepositoryMockDeleteExpectation
+
+	callArgs []*ArticleTagRepositoryMockDeleteParams
+	mutex    sync.RWMutex
+}
+
+// ArticleTagRepositoryMockDeleteExpectation specifies expectation struct of the ArticleTagRepository.Delete
+type ArticleTagRepositoryMockDeleteExpectation struct {
+	mock    *ArticleTagRepositoryMock
+	params  *ArticleTagRepositoryMockDeleteParams
+	results *ArticleTagRepositoryMockDeleteResults
+	Counter uint64
+}
+
+// ArticleTagRepositoryMockDeleteParams contains parameters of the ArticleTagRepository.Delete
+type ArticleTagRepositoryMockDeleteParams struct {
+	ctx       context.Context
+	articleID int
+	tagIDs    []int
+}
+
+// ArticleTagRepositoryMockDeleteResults contains results of the ArticleTagRepository.Delete
+type ArticleTagRepositoryMockDeleteResults struct {
+	err error
+}
+
+// Expect sets up expected params for ArticleTagRepository.Delete
+func (mmDelete *mArticleTagRepositoryMockDelete) Expect(ctx context.Context, articleID int, tagIDs []int) *mArticleTagRepositoryMockDelete {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ArticleTagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &ArticleTagRepositoryMockDeleteExpectation{}
+	}
+
+	mmDelete.defaultExpectation.params = &ArticleTagRepositoryMockDeleteParams{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 ArticleTagRepository.Delete
+func (mmDelete *mArticleTagRepositoryMockDelete) Inspect(f func(ctx context.Context, articleID int, tagIDs []int)) *mArticleTagRepositoryMockDelete {
+	if mmDelete.mock.inspectFuncDelete != nil {
+		mmDelete.mock.t.Fatalf("Inspect function is already set for ArticleTagRepositoryMock.Delete")
+	}
+
+	mmDelete.mock.inspectFuncDelete = f
+
+	return mmDelete
+}
+
+// Return sets up results that will be returned by ArticleTagRepository.Delete
+func (mmDelete *mArticleTagRepositoryMockDelete) Return(err error) *ArticleTagRepositoryMock {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ArticleTagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &ArticleTagRepositoryMockDeleteExpectation{mock: mmDelete.mock}
+	}
+	mmDelete.defaultExpectation.results = &ArticleTagRepositoryMockDeleteResults{err}
+	return mmDelete.mock
+}
+
+// Set uses given function f to mock the ArticleTagRepository.Delete method
+func (mmDelete *mArticleTagRepositoryMockDelete) Set(f func(ctx context.Context, articleID int, tagIDs []int) (err error)) *ArticleTagRepositoryMock {
+	if mmDelete.defaultExpectation != nil {
+		mmDelete.mock.t.Fatalf("Default expectation is already set for the ArticleTagRepository.Delete method")
+	}
+
+	if len(mmDelete.expectations) > 0 {
+		mmDelete.mock.t.Fatalf("Some expectations are already set for the ArticleTagRepository.Delete method")
+	}
+
+	mmDelete.mock.funcDelete = f
+	return mmDelete.mock
+}
+
+// When sets expectation for the ArticleTagRepository.Delete which will trigger the result defined by the following
+// Then helper
+func (mmDelete *mArticleTagRepositoryMockDelete) When(ctx context.Context, articleID int, tagIDs []int) *ArticleTagRepositoryMockDeleteExpectation {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("ArticleTagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	expectation := &ArticleTagRepositoryMockDeleteExpectation{
+		mock:   mmDelete.mock,
+		params: &ArticleTagRepositoryMockDeleteParams{ctx, articleID, tagIDs},
+	}
+	mmDelete.expectations = append(mmDelete.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleTagRepository.Delete return parameters for the expectation previously defined by the When method
+func (e *ArticleTagRepositoryMockDeleteExpectation) Then(err error) *ArticleTagRepositoryMock {
+	e.results = &ArticleTagRepositoryMockDeleteResults{err}
+	return e.mock
+}
+
+// Delete implements interfaces.ArticleTagRepository
+func (mmDelete *ArticleTagRepositoryMock) 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 := &ArticleTagRepositoryMockDeleteParams{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 := ArticleTagRepositoryMockDeleteParams{ctx, articleID, tagIDs}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDelete.t.Errorf("ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.Delete")
+		}
+		return (*mm_results).err
+	}
+	if mmDelete.funcDelete != nil {
+		return mmDelete.funcDelete(ctx, articleID, tagIDs)
+	}
+	mmDelete.t.Fatalf("Unexpected call to ArticleTagRepositoryMock.Delete. %v %v %v", ctx, articleID, tagIDs)
+	return
+}
+
+// DeleteAfterCounter returns a count of finished ArticleTagRepositoryMock.Delete invocations
+func (mmDelete *ArticleTagRepositoryMock) DeleteAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.afterDeleteCounter)
+}
+
+// DeleteBeforeCounter returns a count of ArticleTagRepositoryMock.Delete invocations
+func (mmDelete *ArticleTagRepositoryMock) DeleteBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.beforeDeleteCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleTagRepositoryMock.Delete.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDelete *mArticleTagRepositoryMockDelete) Calls() []*ArticleTagRepositoryMockDeleteParams {
+	mmDelete.mutex.RLock()
+
+	argCopy := make([]*ArticleTagRepositoryMockDeleteParams, 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 *ArticleTagRepositoryMock) 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 *ArticleTagRepositoryMock) MinimockDeleteInspect() {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.Delete")
+		} else {
+			m.t.Errorf("Expected call to ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.Delete")
+	}
+}
+
+type mArticleTagRepositoryMockDeleteByArticleID struct {
+	mock               *ArticleTagRepositoryMock
+	defaultExpectation *ArticleTagRepositoryMockDeleteByArticleIDExpectation
+	expectations       []*ArticleTagRepositoryMockDeleteByArticleIDExpectation
+
+	callArgs []*ArticleTagRepositoryMockDeleteByArticleIDParams
+	mutex    sync.RWMutex
+}
+
+// ArticleTagRepositoryMockDeleteByArticleIDExpectation specifies expectation struct of the ArticleTagRepository.DeleteByArticleID
+type ArticleTagRepositoryMockDeleteByArticleIDExpectation struct {
+	mock    *ArticleTagRepositoryMock
+	params  *ArticleTagRepositoryMockDeleteByArticleIDParams
+	results *ArticleTagRepositoryMockDeleteByArticleIDResults
+	Counter uint64
+}
+
+// ArticleTagRepositoryMockDeleteByArticleIDParams contains parameters of the ArticleTagRepository.DeleteByArticleID
+type ArticleTagRepositoryMockDeleteByArticleIDParams struct {
+	ctx       context.Context
+	articleID int
+}
+
+// ArticleTagRepositoryMockDeleteByArticleIDResults contains results of the ArticleTagRepository.DeleteByArticleID
+type ArticleTagRepositoryMockDeleteByArticleIDResults struct {
+	err error
+}
+
+// Expect sets up expected params for ArticleTagRepository.DeleteByArticleID
+func (mmDeleteByArticleID *mArticleTagRepositoryMockDeleteByArticleID) Expect(ctx context.Context, articleID int) *mArticleTagRepositoryMockDeleteByArticleID {
+	if mmDeleteByArticleID.mock.funcDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("ArticleTagRepositoryMock.DeleteByArticleID mock is already set by Set")
+	}
+
+	if mmDeleteByArticleID.defaultExpectation == nil {
+		mmDeleteByArticleID.defaultExpectation = &ArticleTagRepositoryMockDeleteByArticleIDExpectation{}
+	}
+
+	mmDeleteByArticleID.defaultExpectation.params = &ArticleTagRepositoryMockDeleteByArticleIDParams{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 ArticleTagRepository.DeleteByArticleID
+func (mmDeleteByArticleID *mArticleTagRepositoryMockDeleteByArticleID) Inspect(f func(ctx context.Context, articleID int)) *mArticleTagRepositoryMockDeleteByArticleID {
+	if mmDeleteByArticleID.mock.inspectFuncDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("Inspect function is already set for ArticleTagRepositoryMock.DeleteByArticleID")
+	}
+
+	mmDeleteByArticleID.mock.inspectFuncDeleteByArticleID = f
+
+	return mmDeleteByArticleID
+}
+
+// Return sets up results that will be returned by ArticleTagRepository.DeleteByArticleID
+func (mmDeleteByArticleID *mArticleTagRepositoryMockDeleteByArticleID) Return(err error) *ArticleTagRepositoryMock {
+	if mmDeleteByArticleID.mock.funcDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("ArticleTagRepositoryMock.DeleteByArticleID mock is already set by Set")
+	}
+
+	if mmDeleteByArticleID.defaultExpectation == nil {
+		mmDeleteByArticleID.defaultExpectation = &ArticleTagRepositoryMockDeleteByArticleIDExpectation{mock: mmDeleteByArticleID.mock}
+	}
+	mmDeleteByArticleID.defaultExpectation.results = &ArticleTagRepositoryMockDeleteByArticleIDResults{err}
+	return mmDeleteByArticleID.mock
+}
+
+// Set uses given function f to mock the ArticleTagRepository.DeleteByArticleID method
+func (mmDeleteByArticleID *mArticleTagRepositoryMockDeleteByArticleID) Set(f func(ctx context.Context, articleID int) (err error)) *ArticleTagRepositoryMock {
+	if mmDeleteByArticleID.defaultExpectation != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("Default expectation is already set for the ArticleTagRepository.DeleteByArticleID method")
+	}
+
+	if len(mmDeleteByArticleID.expectations) > 0 {
+		mmDeleteByArticleID.mock.t.Fatalf("Some expectations are already set for the ArticleTagRepository.DeleteByArticleID method")
+	}
+
+	mmDeleteByArticleID.mock.funcDeleteByArticleID = f
+	return mmDeleteByArticleID.mock
+}
+
+// When sets expectation for the ArticleTagRepository.DeleteByArticleID which will trigger the result defined by the following
+// Then helper
+func (mmDeleteByArticleID *mArticleTagRepositoryMockDeleteByArticleID) When(ctx context.Context, articleID int) *ArticleTagRepositoryMockDeleteByArticleIDExpectation {
+	if mmDeleteByArticleID.mock.funcDeleteByArticleID != nil {
+		mmDeleteByArticleID.mock.t.Fatalf("ArticleTagRepositoryMock.DeleteByArticleID mock is already set by Set")
+	}
+
+	expectation := &ArticleTagRepositoryMockDeleteByArticleIDExpectation{
+		mock:   mmDeleteByArticleID.mock,
+		params: &ArticleTagRepositoryMockDeleteByArticleIDParams{ctx, articleID},
+	}
+	mmDeleteByArticleID.expectations = append(mmDeleteByArticleID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up ArticleTagRepository.DeleteByArticleID return parameters for the expectation previously defined by the When method
+func (e *ArticleTagRepositoryMockDeleteByArticleIDExpectation) Then(err error) *ArticleTagRepositoryMock {
+	e.results = &ArticleTagRepositoryMockDeleteByArticleIDResults{err}
+	return e.mock
+}
+
+// DeleteByArticleID implements interfaces.ArticleTagRepository
+func (mmDeleteByArticleID *ArticleTagRepositoryMock) 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 := &ArticleTagRepositoryMockDeleteByArticleIDParams{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 := ArticleTagRepositoryMockDeleteByArticleIDParams{ctx, articleID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDeleteByArticleID.t.Errorf("ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.DeleteByArticleID")
+		}
+		return (*mm_results).err
+	}
+	if mmDeleteByArticleID.funcDeleteByArticleID != nil {
+		return mmDeleteByArticleID.funcDeleteByArticleID(ctx, articleID)
+	}
+	mmDeleteByArticleID.t.Fatalf("Unexpected call to ArticleTagRepositoryMock.DeleteByArticleID. %v %v", ctx, articleID)
+	return
+}
+
+// DeleteByArticleIDAfterCounter returns a count of finished ArticleTagRepositoryMock.DeleteByArticleID invocations
+func (mmDeleteByArticleID *ArticleTagRepositoryMock) DeleteByArticleIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDeleteByArticleID.afterDeleteByArticleIDCounter)
+}
+
+// DeleteByArticleIDBeforeCounter returns a count of ArticleTagRepositoryMock.DeleteByArticleID invocations
+func (mmDeleteByArticleID *ArticleTagRepositoryMock) DeleteByArticleIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDeleteByArticleID.beforeDeleteByArticleIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to ArticleTagRepositoryMock.DeleteByArticleID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDeleteByArticleID *mArticleTagRepositoryMockDeleteByArticleID) Calls() []*ArticleTagRepositoryMockDeleteByArticleIDParams {
+	mmDeleteByArticleID.mutex.RLock()
+
+	argCopy := make([]*ArticleTagRepositoryMockDeleteByArticleIDParams, 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 *ArticleTagRepositoryMock) 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 *ArticleTagRepositoryMock) MinimockDeleteByArticleIDInspect() {
+	for _, e := range m.DeleteByArticleIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.DeleteByArticleID")
+		} else {
+			m.t.Errorf("Expected call to ArticleTagRepositoryMock.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 ArticleTagRepositoryMock.DeleteByArticleID")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *ArticleTagRepositoryMock) 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 *ArticleTagRepositoryMock) 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 *ArticleTagRepositoryMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockAddDone() &&
+		m.MinimockDeleteDone() &&
+		m.MinimockDeleteByArticleIDDone()
+}

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

@@ -1,1885 +0,0 @@
-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()
-}

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

@@ -1,742 +0,0 @@
-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()
-}

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

@@ -1,2113 +0,0 @@
-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()
-}

+ 2113 - 0
internal/repositories/mocks/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.TagRepository -o ./mocks/tag_repository_minimock.go -n TagRepositoryMock
+
+import (
+	"context"
+	"sync"
+	mm_atomic "sync/atomic"
+	mm_time "time"
+
+	"github.com/dmitriygnatenko/internal/models"
+	"github.com/gojuno/minimock/v3"
+)
+
+// TagRepositoryMock implements interfaces.TagRepository
+type TagRepositoryMock 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          mTagRepositoryMockAdd
+
+	funcDelete          func(ctx context.Context, ID int) (err error)
+	inspectFuncDelete   func(ctx context.Context, ID int)
+	afterDeleteCounter  uint64
+	beforeDeleteCounter uint64
+	DeleteMock          mTagRepositoryMockDelete
+
+	funcGetAll          func(ctx context.Context) (ta1 []models.Tag, err error)
+	inspectFuncGetAll   func(ctx context.Context)
+	afterGetAllCounter  uint64
+	beforeGetAllCounter uint64
+	GetAllMock          mTagRepositoryMockGetAll
+
+	funcGetAllUsed          func(ctx context.Context) (ta1 []models.Tag, err error)
+	inspectFuncGetAllUsed   func(ctx context.Context)
+	afterGetAllUsedCounter  uint64
+	beforeGetAllUsedCounter uint64
+	GetAllUsedMock          mTagRepositoryMockGetAllUsed
+
+	funcGetByArticleID          func(ctx context.Context, ID int) (ta1 []models.Tag, err error)
+	inspectFuncGetByArticleID   func(ctx context.Context, ID int)
+	afterGetByArticleIDCounter  uint64
+	beforeGetByArticleIDCounter uint64
+	GetByArticleIDMock          mTagRepositoryMockGetByArticleID
+
+	funcGetByID          func(ctx context.Context, ID int) (tp1 *models.Tag, err error)
+	inspectFuncGetByID   func(ctx context.Context, ID int)
+	afterGetByIDCounter  uint64
+	beforeGetByIDCounter uint64
+	GetByIDMock          mTagRepositoryMockGetByID
+
+	funcGetByURL          func(ctx context.Context, tag string) (tp1 *models.Tag, err error)
+	inspectFuncGetByURL   func(ctx context.Context, tag string)
+	afterGetByURLCounter  uint64
+	beforeGetByURLCounter uint64
+	GetByURLMock          mTagRepositoryMockGetByURL
+
+	funcIsUsed          func(ctx context.Context, ID int) (b1 bool, err error)
+	inspectFuncIsUsed   func(ctx context.Context, ID int)
+	afterIsUsedCounter  uint64
+	beforeIsUsedCounter uint64
+	IsUsedMock          mTagRepositoryMockIsUsed
+
+	funcUpdate          func(ctx context.Context, m models.Tag) (err error)
+	inspectFuncUpdate   func(ctx context.Context, m models.Tag)
+	afterUpdateCounter  uint64
+	beforeUpdateCounter uint64
+	UpdateMock          mTagRepositoryMockUpdate
+}
+
+// NewTagRepositoryMock returns a mock for interfaces.TagRepository
+func NewTagRepositoryMock(t minimock.Tester) *TagRepositoryMock {
+	m := &TagRepositoryMock{t: t}
+	if controller, ok := t.(minimock.MockController); ok {
+		controller.RegisterMocker(m)
+	}
+
+	m.AddMock = mTagRepositoryMockAdd{mock: m}
+	m.AddMock.callArgs = []*TagRepositoryMockAddParams{}
+
+	m.DeleteMock = mTagRepositoryMockDelete{mock: m}
+	m.DeleteMock.callArgs = []*TagRepositoryMockDeleteParams{}
+
+	m.GetAllMock = mTagRepositoryMockGetAll{mock: m}
+	m.GetAllMock.callArgs = []*TagRepositoryMockGetAllParams{}
+
+	m.GetAllUsedMock = mTagRepositoryMockGetAllUsed{mock: m}
+	m.GetAllUsedMock.callArgs = []*TagRepositoryMockGetAllUsedParams{}
+
+	m.GetByArticleIDMock = mTagRepositoryMockGetByArticleID{mock: m}
+	m.GetByArticleIDMock.callArgs = []*TagRepositoryMockGetByArticleIDParams{}
+
+	m.GetByIDMock = mTagRepositoryMockGetByID{mock: m}
+	m.GetByIDMock.callArgs = []*TagRepositoryMockGetByIDParams{}
+
+	m.GetByURLMock = mTagRepositoryMockGetByURL{mock: m}
+	m.GetByURLMock.callArgs = []*TagRepositoryMockGetByURLParams{}
+
+	m.IsUsedMock = mTagRepositoryMockIsUsed{mock: m}
+	m.IsUsedMock.callArgs = []*TagRepositoryMockIsUsedParams{}
+
+	m.UpdateMock = mTagRepositoryMockUpdate{mock: m}
+	m.UpdateMock.callArgs = []*TagRepositoryMockUpdateParams{}
+
+	return m
+}
+
+type mTagRepositoryMockAdd struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockAddExpectation
+	expectations       []*TagRepositoryMockAddExpectation
+
+	callArgs []*TagRepositoryMockAddParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockAddExpectation specifies expectation struct of the TagRepository.Add
+type TagRepositoryMockAddExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockAddParams
+	results *TagRepositoryMockAddResults
+	Counter uint64
+}
+
+// TagRepositoryMockAddParams contains parameters of the TagRepository.Add
+type TagRepositoryMockAddParams struct {
+	ctx context.Context
+	m   models.Tag
+}
+
+// TagRepositoryMockAddResults contains results of the TagRepository.Add
+type TagRepositoryMockAddResults struct {
+	err error
+}
+
+// Expect sets up expected params for TagRepository.Add
+func (mmAdd *mTagRepositoryMockAdd) Expect(ctx context.Context, m models.Tag) *mTagRepositoryMockAdd {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("TagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &TagRepositoryMockAddExpectation{}
+	}
+
+	mmAdd.defaultExpectation.params = &TagRepositoryMockAddParams{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 TagRepository.Add
+func (mmAdd *mTagRepositoryMockAdd) Inspect(f func(ctx context.Context, m models.Tag)) *mTagRepositoryMockAdd {
+	if mmAdd.mock.inspectFuncAdd != nil {
+		mmAdd.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.Add")
+	}
+
+	mmAdd.mock.inspectFuncAdd = f
+
+	return mmAdd
+}
+
+// Return sets up results that will be returned by TagRepository.Add
+func (mmAdd *mTagRepositoryMockAdd) Return(err error) *TagRepositoryMock {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("TagRepositoryMock.Add mock is already set by Set")
+	}
+
+	if mmAdd.defaultExpectation == nil {
+		mmAdd.defaultExpectation = &TagRepositoryMockAddExpectation{mock: mmAdd.mock}
+	}
+	mmAdd.defaultExpectation.results = &TagRepositoryMockAddResults{err}
+	return mmAdd.mock
+}
+
+// Set uses given function f to mock the TagRepository.Add method
+func (mmAdd *mTagRepositoryMockAdd) Set(f func(ctx context.Context, m models.Tag) (err error)) *TagRepositoryMock {
+	if mmAdd.defaultExpectation != nil {
+		mmAdd.mock.t.Fatalf("Default expectation is already set for the TagRepository.Add method")
+	}
+
+	if len(mmAdd.expectations) > 0 {
+		mmAdd.mock.t.Fatalf("Some expectations are already set for the TagRepository.Add method")
+	}
+
+	mmAdd.mock.funcAdd = f
+	return mmAdd.mock
+}
+
+// When sets expectation for the TagRepository.Add which will trigger the result defined by the following
+// Then helper
+func (mmAdd *mTagRepositoryMockAdd) When(ctx context.Context, m models.Tag) *TagRepositoryMockAddExpectation {
+	if mmAdd.mock.funcAdd != nil {
+		mmAdd.mock.t.Fatalf("TagRepositoryMock.Add mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockAddExpectation{
+		mock:   mmAdd.mock,
+		params: &TagRepositoryMockAddParams{ctx, m},
+	}
+	mmAdd.expectations = append(mmAdd.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.Add return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockAddExpectation) Then(err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockAddResults{err}
+	return e.mock
+}
+
+// Add implements interfaces.TagRepository
+func (mmAdd *TagRepositoryMock) 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 := &TagRepositoryMockAddParams{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 := TagRepositoryMockAddParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmAdd.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.Add")
+		}
+		return (*mm_results).err
+	}
+	if mmAdd.funcAdd != nil {
+		return mmAdd.funcAdd(ctx, m)
+	}
+	mmAdd.t.Fatalf("Unexpected call to TagRepositoryMock.Add. %v %v", ctx, m)
+	return
+}
+
+// AddAfterCounter returns a count of finished TagRepositoryMock.Add invocations
+func (mmAdd *TagRepositoryMock) AddAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.afterAddCounter)
+}
+
+// AddBeforeCounter returns a count of TagRepositoryMock.Add invocations
+func (mmAdd *TagRepositoryMock) AddBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmAdd.beforeAddCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.Add.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmAdd *mTagRepositoryMockAdd) Calls() []*TagRepositoryMockAddParams {
+	mmAdd.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockAddParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockAddInspect() {
+	for _, e := range m.AddMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.Add")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.Add")
+	}
+}
+
+type mTagRepositoryMockDelete struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockDeleteExpectation
+	expectations       []*TagRepositoryMockDeleteExpectation
+
+	callArgs []*TagRepositoryMockDeleteParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockDeleteExpectation specifies expectation struct of the TagRepository.Delete
+type TagRepositoryMockDeleteExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockDeleteParams
+	results *TagRepositoryMockDeleteResults
+	Counter uint64
+}
+
+// TagRepositoryMockDeleteParams contains parameters of the TagRepository.Delete
+type TagRepositoryMockDeleteParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// TagRepositoryMockDeleteResults contains results of the TagRepository.Delete
+type TagRepositoryMockDeleteResults struct {
+	err error
+}
+
+// Expect sets up expected params for TagRepository.Delete
+func (mmDelete *mTagRepositoryMockDelete) Expect(ctx context.Context, ID int) *mTagRepositoryMockDelete {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("TagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &TagRepositoryMockDeleteExpectation{}
+	}
+
+	mmDelete.defaultExpectation.params = &TagRepositoryMockDeleteParams{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 TagRepository.Delete
+func (mmDelete *mTagRepositoryMockDelete) Inspect(f func(ctx context.Context, ID int)) *mTagRepositoryMockDelete {
+	if mmDelete.mock.inspectFuncDelete != nil {
+		mmDelete.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.Delete")
+	}
+
+	mmDelete.mock.inspectFuncDelete = f
+
+	return mmDelete
+}
+
+// Return sets up results that will be returned by TagRepository.Delete
+func (mmDelete *mTagRepositoryMockDelete) Return(err error) *TagRepositoryMock {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("TagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	if mmDelete.defaultExpectation == nil {
+		mmDelete.defaultExpectation = &TagRepositoryMockDeleteExpectation{mock: mmDelete.mock}
+	}
+	mmDelete.defaultExpectation.results = &TagRepositoryMockDeleteResults{err}
+	return mmDelete.mock
+}
+
+// Set uses given function f to mock the TagRepository.Delete method
+func (mmDelete *mTagRepositoryMockDelete) Set(f func(ctx context.Context, ID int) (err error)) *TagRepositoryMock {
+	if mmDelete.defaultExpectation != nil {
+		mmDelete.mock.t.Fatalf("Default expectation is already set for the TagRepository.Delete method")
+	}
+
+	if len(mmDelete.expectations) > 0 {
+		mmDelete.mock.t.Fatalf("Some expectations are already set for the TagRepository.Delete method")
+	}
+
+	mmDelete.mock.funcDelete = f
+	return mmDelete.mock
+}
+
+// When sets expectation for the TagRepository.Delete which will trigger the result defined by the following
+// Then helper
+func (mmDelete *mTagRepositoryMockDelete) When(ctx context.Context, ID int) *TagRepositoryMockDeleteExpectation {
+	if mmDelete.mock.funcDelete != nil {
+		mmDelete.mock.t.Fatalf("TagRepositoryMock.Delete mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockDeleteExpectation{
+		mock:   mmDelete.mock,
+		params: &TagRepositoryMockDeleteParams{ctx, ID},
+	}
+	mmDelete.expectations = append(mmDelete.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.Delete return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockDeleteExpectation) Then(err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockDeleteResults{err}
+	return e.mock
+}
+
+// Delete implements interfaces.TagRepository
+func (mmDelete *TagRepositoryMock) 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 := &TagRepositoryMockDeleteParams{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 := TagRepositoryMockDeleteParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmDelete.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.Delete")
+		}
+		return (*mm_results).err
+	}
+	if mmDelete.funcDelete != nil {
+		return mmDelete.funcDelete(ctx, ID)
+	}
+	mmDelete.t.Fatalf("Unexpected call to TagRepositoryMock.Delete. %v %v", ctx, ID)
+	return
+}
+
+// DeleteAfterCounter returns a count of finished TagRepositoryMock.Delete invocations
+func (mmDelete *TagRepositoryMock) DeleteAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.afterDeleteCounter)
+}
+
+// DeleteBeforeCounter returns a count of TagRepositoryMock.Delete invocations
+func (mmDelete *TagRepositoryMock) DeleteBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmDelete.beforeDeleteCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.Delete.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmDelete *mTagRepositoryMockDelete) Calls() []*TagRepositoryMockDeleteParams {
+	mmDelete.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockDeleteParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockDeleteInspect() {
+	for _, e := range m.DeleteMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.Delete")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.Delete")
+	}
+}
+
+type mTagRepositoryMockGetAll struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockGetAllExpectation
+	expectations       []*TagRepositoryMockGetAllExpectation
+
+	callArgs []*TagRepositoryMockGetAllParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockGetAllExpectation specifies expectation struct of the TagRepository.GetAll
+type TagRepositoryMockGetAllExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockGetAllParams
+	results *TagRepositoryMockGetAllResults
+	Counter uint64
+}
+
+// TagRepositoryMockGetAllParams contains parameters of the TagRepository.GetAll
+type TagRepositoryMockGetAllParams struct {
+	ctx context.Context
+}
+
+// TagRepositoryMockGetAllResults contains results of the TagRepository.GetAll
+type TagRepositoryMockGetAllResults struct {
+	ta1 []models.Tag
+	err error
+}
+
+// Expect sets up expected params for TagRepository.GetAll
+func (mmGetAll *mTagRepositoryMockGetAll) Expect(ctx context.Context) *mTagRepositoryMockGetAll {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("TagRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &TagRepositoryMockGetAllExpectation{}
+	}
+
+	mmGetAll.defaultExpectation.params = &TagRepositoryMockGetAllParams{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 TagRepository.GetAll
+func (mmGetAll *mTagRepositoryMockGetAll) Inspect(f func(ctx context.Context)) *mTagRepositoryMockGetAll {
+	if mmGetAll.mock.inspectFuncGetAll != nil {
+		mmGetAll.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.GetAll")
+	}
+
+	mmGetAll.mock.inspectFuncGetAll = f
+
+	return mmGetAll
+}
+
+// Return sets up results that will be returned by TagRepository.GetAll
+func (mmGetAll *mTagRepositoryMockGetAll) Return(ta1 []models.Tag, err error) *TagRepositoryMock {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("TagRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	if mmGetAll.defaultExpectation == nil {
+		mmGetAll.defaultExpectation = &TagRepositoryMockGetAllExpectation{mock: mmGetAll.mock}
+	}
+	mmGetAll.defaultExpectation.results = &TagRepositoryMockGetAllResults{ta1, err}
+	return mmGetAll.mock
+}
+
+// Set uses given function f to mock the TagRepository.GetAll method
+func (mmGetAll *mTagRepositoryMockGetAll) Set(f func(ctx context.Context) (ta1 []models.Tag, err error)) *TagRepositoryMock {
+	if mmGetAll.defaultExpectation != nil {
+		mmGetAll.mock.t.Fatalf("Default expectation is already set for the TagRepository.GetAll method")
+	}
+
+	if len(mmGetAll.expectations) > 0 {
+		mmGetAll.mock.t.Fatalf("Some expectations are already set for the TagRepository.GetAll method")
+	}
+
+	mmGetAll.mock.funcGetAll = f
+	return mmGetAll.mock
+}
+
+// When sets expectation for the TagRepository.GetAll which will trigger the result defined by the following
+// Then helper
+func (mmGetAll *mTagRepositoryMockGetAll) When(ctx context.Context) *TagRepositoryMockGetAllExpectation {
+	if mmGetAll.mock.funcGetAll != nil {
+		mmGetAll.mock.t.Fatalf("TagRepositoryMock.GetAll mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockGetAllExpectation{
+		mock:   mmGetAll.mock,
+		params: &TagRepositoryMockGetAllParams{ctx},
+	}
+	mmGetAll.expectations = append(mmGetAll.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.GetAll return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockGetAllExpectation) Then(ta1 []models.Tag, err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockGetAllResults{ta1, err}
+	return e.mock
+}
+
+// GetAll implements interfaces.TagRepository
+func (mmGetAll *TagRepositoryMock) 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 := &TagRepositoryMockGetAllParams{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 := TagRepositoryMockGetAllParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAll.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.GetAll")
+		}
+		return (*mm_results).ta1, (*mm_results).err
+	}
+	if mmGetAll.funcGetAll != nil {
+		return mmGetAll.funcGetAll(ctx)
+	}
+	mmGetAll.t.Fatalf("Unexpected call to TagRepositoryMock.GetAll. %v", ctx)
+	return
+}
+
+// GetAllAfterCounter returns a count of finished TagRepositoryMock.GetAll invocations
+func (mmGetAll *TagRepositoryMock) GetAllAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.afterGetAllCounter)
+}
+
+// GetAllBeforeCounter returns a count of TagRepositoryMock.GetAll invocations
+func (mmGetAll *TagRepositoryMock) GetAllBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAll.beforeGetAllCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.GetAll.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAll *mTagRepositoryMockGetAll) Calls() []*TagRepositoryMockGetAllParams {
+	mmGetAll.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockGetAllParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockGetAllInspect() {
+	for _, e := range m.GetAllMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetAll")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetAll")
+	}
+}
+
+type mTagRepositoryMockGetAllUsed struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockGetAllUsedExpectation
+	expectations       []*TagRepositoryMockGetAllUsedExpectation
+
+	callArgs []*TagRepositoryMockGetAllUsedParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockGetAllUsedExpectation specifies expectation struct of the TagRepository.GetAllUsed
+type TagRepositoryMockGetAllUsedExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockGetAllUsedParams
+	results *TagRepositoryMockGetAllUsedResults
+	Counter uint64
+}
+
+// TagRepositoryMockGetAllUsedParams contains parameters of the TagRepository.GetAllUsed
+type TagRepositoryMockGetAllUsedParams struct {
+	ctx context.Context
+}
+
+// TagRepositoryMockGetAllUsedResults contains results of the TagRepository.GetAllUsed
+type TagRepositoryMockGetAllUsedResults struct {
+	ta1 []models.Tag
+	err error
+}
+
+// Expect sets up expected params for TagRepository.GetAllUsed
+func (mmGetAllUsed *mTagRepositoryMockGetAllUsed) Expect(ctx context.Context) *mTagRepositoryMockGetAllUsed {
+	if mmGetAllUsed.mock.funcGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("TagRepositoryMock.GetAllUsed mock is already set by Set")
+	}
+
+	if mmGetAllUsed.defaultExpectation == nil {
+		mmGetAllUsed.defaultExpectation = &TagRepositoryMockGetAllUsedExpectation{}
+	}
+
+	mmGetAllUsed.defaultExpectation.params = &TagRepositoryMockGetAllUsedParams{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 TagRepository.GetAllUsed
+func (mmGetAllUsed *mTagRepositoryMockGetAllUsed) Inspect(f func(ctx context.Context)) *mTagRepositoryMockGetAllUsed {
+	if mmGetAllUsed.mock.inspectFuncGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.GetAllUsed")
+	}
+
+	mmGetAllUsed.mock.inspectFuncGetAllUsed = f
+
+	return mmGetAllUsed
+}
+
+// Return sets up results that will be returned by TagRepository.GetAllUsed
+func (mmGetAllUsed *mTagRepositoryMockGetAllUsed) Return(ta1 []models.Tag, err error) *TagRepositoryMock {
+	if mmGetAllUsed.mock.funcGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("TagRepositoryMock.GetAllUsed mock is already set by Set")
+	}
+
+	if mmGetAllUsed.defaultExpectation == nil {
+		mmGetAllUsed.defaultExpectation = &TagRepositoryMockGetAllUsedExpectation{mock: mmGetAllUsed.mock}
+	}
+	mmGetAllUsed.defaultExpectation.results = &TagRepositoryMockGetAllUsedResults{ta1, err}
+	return mmGetAllUsed.mock
+}
+
+// Set uses given function f to mock the TagRepository.GetAllUsed method
+func (mmGetAllUsed *mTagRepositoryMockGetAllUsed) Set(f func(ctx context.Context) (ta1 []models.Tag, err error)) *TagRepositoryMock {
+	if mmGetAllUsed.defaultExpectation != nil {
+		mmGetAllUsed.mock.t.Fatalf("Default expectation is already set for the TagRepository.GetAllUsed method")
+	}
+
+	if len(mmGetAllUsed.expectations) > 0 {
+		mmGetAllUsed.mock.t.Fatalf("Some expectations are already set for the TagRepository.GetAllUsed method")
+	}
+
+	mmGetAllUsed.mock.funcGetAllUsed = f
+	return mmGetAllUsed.mock
+}
+
+// When sets expectation for the TagRepository.GetAllUsed which will trigger the result defined by the following
+// Then helper
+func (mmGetAllUsed *mTagRepositoryMockGetAllUsed) When(ctx context.Context) *TagRepositoryMockGetAllUsedExpectation {
+	if mmGetAllUsed.mock.funcGetAllUsed != nil {
+		mmGetAllUsed.mock.t.Fatalf("TagRepositoryMock.GetAllUsed mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockGetAllUsedExpectation{
+		mock:   mmGetAllUsed.mock,
+		params: &TagRepositoryMockGetAllUsedParams{ctx},
+	}
+	mmGetAllUsed.expectations = append(mmGetAllUsed.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.GetAllUsed return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockGetAllUsedExpectation) Then(ta1 []models.Tag, err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockGetAllUsedResults{ta1, err}
+	return e.mock
+}
+
+// GetAllUsed implements interfaces.TagRepository
+func (mmGetAllUsed *TagRepositoryMock) 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 := &TagRepositoryMockGetAllUsedParams{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 := TagRepositoryMockGetAllUsedParams{ctx}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetAllUsed.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.GetAllUsed")
+		}
+		return (*mm_results).ta1, (*mm_results).err
+	}
+	if mmGetAllUsed.funcGetAllUsed != nil {
+		return mmGetAllUsed.funcGetAllUsed(ctx)
+	}
+	mmGetAllUsed.t.Fatalf("Unexpected call to TagRepositoryMock.GetAllUsed. %v", ctx)
+	return
+}
+
+// GetAllUsedAfterCounter returns a count of finished TagRepositoryMock.GetAllUsed invocations
+func (mmGetAllUsed *TagRepositoryMock) GetAllUsedAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllUsed.afterGetAllUsedCounter)
+}
+
+// GetAllUsedBeforeCounter returns a count of TagRepositoryMock.GetAllUsed invocations
+func (mmGetAllUsed *TagRepositoryMock) GetAllUsedBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetAllUsed.beforeGetAllUsedCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.GetAllUsed.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetAllUsed *mTagRepositoryMockGetAllUsed) Calls() []*TagRepositoryMockGetAllUsedParams {
+	mmGetAllUsed.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockGetAllUsedParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockGetAllUsedInspect() {
+	for _, e := range m.GetAllUsedMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetAllUsed")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetAllUsed")
+	}
+}
+
+type mTagRepositoryMockGetByArticleID struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockGetByArticleIDExpectation
+	expectations       []*TagRepositoryMockGetByArticleIDExpectation
+
+	callArgs []*TagRepositoryMockGetByArticleIDParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockGetByArticleIDExpectation specifies expectation struct of the TagRepository.GetByArticleID
+type TagRepositoryMockGetByArticleIDExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockGetByArticleIDParams
+	results *TagRepositoryMockGetByArticleIDResults
+	Counter uint64
+}
+
+// TagRepositoryMockGetByArticleIDParams contains parameters of the TagRepository.GetByArticleID
+type TagRepositoryMockGetByArticleIDParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// TagRepositoryMockGetByArticleIDResults contains results of the TagRepository.GetByArticleID
+type TagRepositoryMockGetByArticleIDResults struct {
+	ta1 []models.Tag
+	err error
+}
+
+// Expect sets up expected params for TagRepository.GetByArticleID
+func (mmGetByArticleID *mTagRepositoryMockGetByArticleID) Expect(ctx context.Context, ID int) *mTagRepositoryMockGetByArticleID {
+	if mmGetByArticleID.mock.funcGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("TagRepositoryMock.GetByArticleID mock is already set by Set")
+	}
+
+	if mmGetByArticleID.defaultExpectation == nil {
+		mmGetByArticleID.defaultExpectation = &TagRepositoryMockGetByArticleIDExpectation{}
+	}
+
+	mmGetByArticleID.defaultExpectation.params = &TagRepositoryMockGetByArticleIDParams{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 TagRepository.GetByArticleID
+func (mmGetByArticleID *mTagRepositoryMockGetByArticleID) Inspect(f func(ctx context.Context, ID int)) *mTagRepositoryMockGetByArticleID {
+	if mmGetByArticleID.mock.inspectFuncGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.GetByArticleID")
+	}
+
+	mmGetByArticleID.mock.inspectFuncGetByArticleID = f
+
+	return mmGetByArticleID
+}
+
+// Return sets up results that will be returned by TagRepository.GetByArticleID
+func (mmGetByArticleID *mTagRepositoryMockGetByArticleID) Return(ta1 []models.Tag, err error) *TagRepositoryMock {
+	if mmGetByArticleID.mock.funcGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("TagRepositoryMock.GetByArticleID mock is already set by Set")
+	}
+
+	if mmGetByArticleID.defaultExpectation == nil {
+		mmGetByArticleID.defaultExpectation = &TagRepositoryMockGetByArticleIDExpectation{mock: mmGetByArticleID.mock}
+	}
+	mmGetByArticleID.defaultExpectation.results = &TagRepositoryMockGetByArticleIDResults{ta1, err}
+	return mmGetByArticleID.mock
+}
+
+// Set uses given function f to mock the TagRepository.GetByArticleID method
+func (mmGetByArticleID *mTagRepositoryMockGetByArticleID) Set(f func(ctx context.Context, ID int) (ta1 []models.Tag, err error)) *TagRepositoryMock {
+	if mmGetByArticleID.defaultExpectation != nil {
+		mmGetByArticleID.mock.t.Fatalf("Default expectation is already set for the TagRepository.GetByArticleID method")
+	}
+
+	if len(mmGetByArticleID.expectations) > 0 {
+		mmGetByArticleID.mock.t.Fatalf("Some expectations are already set for the TagRepository.GetByArticleID method")
+	}
+
+	mmGetByArticleID.mock.funcGetByArticleID = f
+	return mmGetByArticleID.mock
+}
+
+// When sets expectation for the TagRepository.GetByArticleID which will trigger the result defined by the following
+// Then helper
+func (mmGetByArticleID *mTagRepositoryMockGetByArticleID) When(ctx context.Context, ID int) *TagRepositoryMockGetByArticleIDExpectation {
+	if mmGetByArticleID.mock.funcGetByArticleID != nil {
+		mmGetByArticleID.mock.t.Fatalf("TagRepositoryMock.GetByArticleID mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockGetByArticleIDExpectation{
+		mock:   mmGetByArticleID.mock,
+		params: &TagRepositoryMockGetByArticleIDParams{ctx, ID},
+	}
+	mmGetByArticleID.expectations = append(mmGetByArticleID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.GetByArticleID return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockGetByArticleIDExpectation) Then(ta1 []models.Tag, err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockGetByArticleIDResults{ta1, err}
+	return e.mock
+}
+
+// GetByArticleID implements interfaces.TagRepository
+func (mmGetByArticleID *TagRepositoryMock) 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 := &TagRepositoryMockGetByArticleIDParams{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 := TagRepositoryMockGetByArticleIDParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByArticleID.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.GetByArticleID")
+		}
+		return (*mm_results).ta1, (*mm_results).err
+	}
+	if mmGetByArticleID.funcGetByArticleID != nil {
+		return mmGetByArticleID.funcGetByArticleID(ctx, ID)
+	}
+	mmGetByArticleID.t.Fatalf("Unexpected call to TagRepositoryMock.GetByArticleID. %v %v", ctx, ID)
+	return
+}
+
+// GetByArticleIDAfterCounter returns a count of finished TagRepositoryMock.GetByArticleID invocations
+func (mmGetByArticleID *TagRepositoryMock) GetByArticleIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByArticleID.afterGetByArticleIDCounter)
+}
+
+// GetByArticleIDBeforeCounter returns a count of TagRepositoryMock.GetByArticleID invocations
+func (mmGetByArticleID *TagRepositoryMock) GetByArticleIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByArticleID.beforeGetByArticleIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.GetByArticleID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByArticleID *mTagRepositoryMockGetByArticleID) Calls() []*TagRepositoryMockGetByArticleIDParams {
+	mmGetByArticleID.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockGetByArticleIDParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockGetByArticleIDInspect() {
+	for _, e := range m.GetByArticleIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetByArticleID")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetByArticleID")
+	}
+}
+
+type mTagRepositoryMockGetByID struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockGetByIDExpectation
+	expectations       []*TagRepositoryMockGetByIDExpectation
+
+	callArgs []*TagRepositoryMockGetByIDParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockGetByIDExpectation specifies expectation struct of the TagRepository.GetByID
+type TagRepositoryMockGetByIDExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockGetByIDParams
+	results *TagRepositoryMockGetByIDResults
+	Counter uint64
+}
+
+// TagRepositoryMockGetByIDParams contains parameters of the TagRepository.GetByID
+type TagRepositoryMockGetByIDParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// TagRepositoryMockGetByIDResults contains results of the TagRepository.GetByID
+type TagRepositoryMockGetByIDResults struct {
+	tp1 *models.Tag
+	err error
+}
+
+// Expect sets up expected params for TagRepository.GetByID
+func (mmGetByID *mTagRepositoryMockGetByID) Expect(ctx context.Context, ID int) *mTagRepositoryMockGetByID {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("TagRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &TagRepositoryMockGetByIDExpectation{}
+	}
+
+	mmGetByID.defaultExpectation.params = &TagRepositoryMockGetByIDParams{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 TagRepository.GetByID
+func (mmGetByID *mTagRepositoryMockGetByID) Inspect(f func(ctx context.Context, ID int)) *mTagRepositoryMockGetByID {
+	if mmGetByID.mock.inspectFuncGetByID != nil {
+		mmGetByID.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.GetByID")
+	}
+
+	mmGetByID.mock.inspectFuncGetByID = f
+
+	return mmGetByID
+}
+
+// Return sets up results that will be returned by TagRepository.GetByID
+func (mmGetByID *mTagRepositoryMockGetByID) Return(tp1 *models.Tag, err error) *TagRepositoryMock {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("TagRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	if mmGetByID.defaultExpectation == nil {
+		mmGetByID.defaultExpectation = &TagRepositoryMockGetByIDExpectation{mock: mmGetByID.mock}
+	}
+	mmGetByID.defaultExpectation.results = &TagRepositoryMockGetByIDResults{tp1, err}
+	return mmGetByID.mock
+}
+
+// Set uses given function f to mock the TagRepository.GetByID method
+func (mmGetByID *mTagRepositoryMockGetByID) Set(f func(ctx context.Context, ID int) (tp1 *models.Tag, err error)) *TagRepositoryMock {
+	if mmGetByID.defaultExpectation != nil {
+		mmGetByID.mock.t.Fatalf("Default expectation is already set for the TagRepository.GetByID method")
+	}
+
+	if len(mmGetByID.expectations) > 0 {
+		mmGetByID.mock.t.Fatalf("Some expectations are already set for the TagRepository.GetByID method")
+	}
+
+	mmGetByID.mock.funcGetByID = f
+	return mmGetByID.mock
+}
+
+// When sets expectation for the TagRepository.GetByID which will trigger the result defined by the following
+// Then helper
+func (mmGetByID *mTagRepositoryMockGetByID) When(ctx context.Context, ID int) *TagRepositoryMockGetByIDExpectation {
+	if mmGetByID.mock.funcGetByID != nil {
+		mmGetByID.mock.t.Fatalf("TagRepositoryMock.GetByID mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockGetByIDExpectation{
+		mock:   mmGetByID.mock,
+		params: &TagRepositoryMockGetByIDParams{ctx, ID},
+	}
+	mmGetByID.expectations = append(mmGetByID.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.GetByID return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockGetByIDExpectation) Then(tp1 *models.Tag, err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockGetByIDResults{tp1, err}
+	return e.mock
+}
+
+// GetByID implements interfaces.TagRepository
+func (mmGetByID *TagRepositoryMock) 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 := &TagRepositoryMockGetByIDParams{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 := TagRepositoryMockGetByIDParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByID.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.GetByID")
+		}
+		return (*mm_results).tp1, (*mm_results).err
+	}
+	if mmGetByID.funcGetByID != nil {
+		return mmGetByID.funcGetByID(ctx, ID)
+	}
+	mmGetByID.t.Fatalf("Unexpected call to TagRepositoryMock.GetByID. %v %v", ctx, ID)
+	return
+}
+
+// GetByIDAfterCounter returns a count of finished TagRepositoryMock.GetByID invocations
+func (mmGetByID *TagRepositoryMock) GetByIDAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.afterGetByIDCounter)
+}
+
+// GetByIDBeforeCounter returns a count of TagRepositoryMock.GetByID invocations
+func (mmGetByID *TagRepositoryMock) GetByIDBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByID.beforeGetByIDCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.GetByID.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByID *mTagRepositoryMockGetByID) Calls() []*TagRepositoryMockGetByIDParams {
+	mmGetByID.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockGetByIDParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockGetByIDInspect() {
+	for _, e := range m.GetByIDMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetByID")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetByID")
+	}
+}
+
+type mTagRepositoryMockGetByURL struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockGetByURLExpectation
+	expectations       []*TagRepositoryMockGetByURLExpectation
+
+	callArgs []*TagRepositoryMockGetByURLParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockGetByURLExpectation specifies expectation struct of the TagRepository.GetByURL
+type TagRepositoryMockGetByURLExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockGetByURLParams
+	results *TagRepositoryMockGetByURLResults
+	Counter uint64
+}
+
+// TagRepositoryMockGetByURLParams contains parameters of the TagRepository.GetByURL
+type TagRepositoryMockGetByURLParams struct {
+	ctx context.Context
+	tag string
+}
+
+// TagRepositoryMockGetByURLResults contains results of the TagRepository.GetByURL
+type TagRepositoryMockGetByURLResults struct {
+	tp1 *models.Tag
+	err error
+}
+
+// Expect sets up expected params for TagRepository.GetByURL
+func (mmGetByURL *mTagRepositoryMockGetByURL) Expect(ctx context.Context, tag string) *mTagRepositoryMockGetByURL {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("TagRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &TagRepositoryMockGetByURLExpectation{}
+	}
+
+	mmGetByURL.defaultExpectation.params = &TagRepositoryMockGetByURLParams{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 TagRepository.GetByURL
+func (mmGetByURL *mTagRepositoryMockGetByURL) Inspect(f func(ctx context.Context, tag string)) *mTagRepositoryMockGetByURL {
+	if mmGetByURL.mock.inspectFuncGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.GetByURL")
+	}
+
+	mmGetByURL.mock.inspectFuncGetByURL = f
+
+	return mmGetByURL
+}
+
+// Return sets up results that will be returned by TagRepository.GetByURL
+func (mmGetByURL *mTagRepositoryMockGetByURL) Return(tp1 *models.Tag, err error) *TagRepositoryMock {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("TagRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	if mmGetByURL.defaultExpectation == nil {
+		mmGetByURL.defaultExpectation = &TagRepositoryMockGetByURLExpectation{mock: mmGetByURL.mock}
+	}
+	mmGetByURL.defaultExpectation.results = &TagRepositoryMockGetByURLResults{tp1, err}
+	return mmGetByURL.mock
+}
+
+// Set uses given function f to mock the TagRepository.GetByURL method
+func (mmGetByURL *mTagRepositoryMockGetByURL) Set(f func(ctx context.Context, tag string) (tp1 *models.Tag, err error)) *TagRepositoryMock {
+	if mmGetByURL.defaultExpectation != nil {
+		mmGetByURL.mock.t.Fatalf("Default expectation is already set for the TagRepository.GetByURL method")
+	}
+
+	if len(mmGetByURL.expectations) > 0 {
+		mmGetByURL.mock.t.Fatalf("Some expectations are already set for the TagRepository.GetByURL method")
+	}
+
+	mmGetByURL.mock.funcGetByURL = f
+	return mmGetByURL.mock
+}
+
+// When sets expectation for the TagRepository.GetByURL which will trigger the result defined by the following
+// Then helper
+func (mmGetByURL *mTagRepositoryMockGetByURL) When(ctx context.Context, tag string) *TagRepositoryMockGetByURLExpectation {
+	if mmGetByURL.mock.funcGetByURL != nil {
+		mmGetByURL.mock.t.Fatalf("TagRepositoryMock.GetByURL mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockGetByURLExpectation{
+		mock:   mmGetByURL.mock,
+		params: &TagRepositoryMockGetByURLParams{ctx, tag},
+	}
+	mmGetByURL.expectations = append(mmGetByURL.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.GetByURL return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockGetByURLExpectation) Then(tp1 *models.Tag, err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockGetByURLResults{tp1, err}
+	return e.mock
+}
+
+// GetByURL implements interfaces.TagRepository
+func (mmGetByURL *TagRepositoryMock) 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 := &TagRepositoryMockGetByURLParams{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 := TagRepositoryMockGetByURLParams{ctx, tag}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmGetByURL.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.GetByURL")
+		}
+		return (*mm_results).tp1, (*mm_results).err
+	}
+	if mmGetByURL.funcGetByURL != nil {
+		return mmGetByURL.funcGetByURL(ctx, tag)
+	}
+	mmGetByURL.t.Fatalf("Unexpected call to TagRepositoryMock.GetByURL. %v %v", ctx, tag)
+	return
+}
+
+// GetByURLAfterCounter returns a count of finished TagRepositoryMock.GetByURL invocations
+func (mmGetByURL *TagRepositoryMock) GetByURLAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.afterGetByURLCounter)
+}
+
+// GetByURLBeforeCounter returns a count of TagRepositoryMock.GetByURL invocations
+func (mmGetByURL *TagRepositoryMock) GetByURLBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmGetByURL.beforeGetByURLCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.GetByURL.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmGetByURL *mTagRepositoryMockGetByURL) Calls() []*TagRepositoryMockGetByURLParams {
+	mmGetByURL.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockGetByURLParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockGetByURLInspect() {
+	for _, e := range m.GetByURLMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetByURL")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.GetByURL")
+	}
+}
+
+type mTagRepositoryMockIsUsed struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockIsUsedExpectation
+	expectations       []*TagRepositoryMockIsUsedExpectation
+
+	callArgs []*TagRepositoryMockIsUsedParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockIsUsedExpectation specifies expectation struct of the TagRepository.IsUsed
+type TagRepositoryMockIsUsedExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockIsUsedParams
+	results *TagRepositoryMockIsUsedResults
+	Counter uint64
+}
+
+// TagRepositoryMockIsUsedParams contains parameters of the TagRepository.IsUsed
+type TagRepositoryMockIsUsedParams struct {
+	ctx context.Context
+	ID  int
+}
+
+// TagRepositoryMockIsUsedResults contains results of the TagRepository.IsUsed
+type TagRepositoryMockIsUsedResults struct {
+	b1  bool
+	err error
+}
+
+// Expect sets up expected params for TagRepository.IsUsed
+func (mmIsUsed *mTagRepositoryMockIsUsed) Expect(ctx context.Context, ID int) *mTagRepositoryMockIsUsed {
+	if mmIsUsed.mock.funcIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("TagRepositoryMock.IsUsed mock is already set by Set")
+	}
+
+	if mmIsUsed.defaultExpectation == nil {
+		mmIsUsed.defaultExpectation = &TagRepositoryMockIsUsedExpectation{}
+	}
+
+	mmIsUsed.defaultExpectation.params = &TagRepositoryMockIsUsedParams{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 TagRepository.IsUsed
+func (mmIsUsed *mTagRepositoryMockIsUsed) Inspect(f func(ctx context.Context, ID int)) *mTagRepositoryMockIsUsed {
+	if mmIsUsed.mock.inspectFuncIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.IsUsed")
+	}
+
+	mmIsUsed.mock.inspectFuncIsUsed = f
+
+	return mmIsUsed
+}
+
+// Return sets up results that will be returned by TagRepository.IsUsed
+func (mmIsUsed *mTagRepositoryMockIsUsed) Return(b1 bool, err error) *TagRepositoryMock {
+	if mmIsUsed.mock.funcIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("TagRepositoryMock.IsUsed mock is already set by Set")
+	}
+
+	if mmIsUsed.defaultExpectation == nil {
+		mmIsUsed.defaultExpectation = &TagRepositoryMockIsUsedExpectation{mock: mmIsUsed.mock}
+	}
+	mmIsUsed.defaultExpectation.results = &TagRepositoryMockIsUsedResults{b1, err}
+	return mmIsUsed.mock
+}
+
+// Set uses given function f to mock the TagRepository.IsUsed method
+func (mmIsUsed *mTagRepositoryMockIsUsed) Set(f func(ctx context.Context, ID int) (b1 bool, err error)) *TagRepositoryMock {
+	if mmIsUsed.defaultExpectation != nil {
+		mmIsUsed.mock.t.Fatalf("Default expectation is already set for the TagRepository.IsUsed method")
+	}
+
+	if len(mmIsUsed.expectations) > 0 {
+		mmIsUsed.mock.t.Fatalf("Some expectations are already set for the TagRepository.IsUsed method")
+	}
+
+	mmIsUsed.mock.funcIsUsed = f
+	return mmIsUsed.mock
+}
+
+// When sets expectation for the TagRepository.IsUsed which will trigger the result defined by the following
+// Then helper
+func (mmIsUsed *mTagRepositoryMockIsUsed) When(ctx context.Context, ID int) *TagRepositoryMockIsUsedExpectation {
+	if mmIsUsed.mock.funcIsUsed != nil {
+		mmIsUsed.mock.t.Fatalf("TagRepositoryMock.IsUsed mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockIsUsedExpectation{
+		mock:   mmIsUsed.mock,
+		params: &TagRepositoryMockIsUsedParams{ctx, ID},
+	}
+	mmIsUsed.expectations = append(mmIsUsed.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.IsUsed return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockIsUsedExpectation) Then(b1 bool, err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockIsUsedResults{b1, err}
+	return e.mock
+}
+
+// IsUsed implements interfaces.TagRepository
+func (mmIsUsed *TagRepositoryMock) 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 := &TagRepositoryMockIsUsedParams{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 := TagRepositoryMockIsUsedParams{ctx, ID}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmIsUsed.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.IsUsed")
+		}
+		return (*mm_results).b1, (*mm_results).err
+	}
+	if mmIsUsed.funcIsUsed != nil {
+		return mmIsUsed.funcIsUsed(ctx, ID)
+	}
+	mmIsUsed.t.Fatalf("Unexpected call to TagRepositoryMock.IsUsed. %v %v", ctx, ID)
+	return
+}
+
+// IsUsedAfterCounter returns a count of finished TagRepositoryMock.IsUsed invocations
+func (mmIsUsed *TagRepositoryMock) IsUsedAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmIsUsed.afterIsUsedCounter)
+}
+
+// IsUsedBeforeCounter returns a count of TagRepositoryMock.IsUsed invocations
+func (mmIsUsed *TagRepositoryMock) IsUsedBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmIsUsed.beforeIsUsedCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.IsUsed.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmIsUsed *mTagRepositoryMockIsUsed) Calls() []*TagRepositoryMockIsUsedParams {
+	mmIsUsed.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockIsUsedParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockIsUsedInspect() {
+	for _, e := range m.IsUsedMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.IsUsed")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.IsUsed")
+	}
+}
+
+type mTagRepositoryMockUpdate struct {
+	mock               *TagRepositoryMock
+	defaultExpectation *TagRepositoryMockUpdateExpectation
+	expectations       []*TagRepositoryMockUpdateExpectation
+
+	callArgs []*TagRepositoryMockUpdateParams
+	mutex    sync.RWMutex
+}
+
+// TagRepositoryMockUpdateExpectation specifies expectation struct of the TagRepository.Update
+type TagRepositoryMockUpdateExpectation struct {
+	mock    *TagRepositoryMock
+	params  *TagRepositoryMockUpdateParams
+	results *TagRepositoryMockUpdateResults
+	Counter uint64
+}
+
+// TagRepositoryMockUpdateParams contains parameters of the TagRepository.Update
+type TagRepositoryMockUpdateParams struct {
+	ctx context.Context
+	m   models.Tag
+}
+
+// TagRepositoryMockUpdateResults contains results of the TagRepository.Update
+type TagRepositoryMockUpdateResults struct {
+	err error
+}
+
+// Expect sets up expected params for TagRepository.Update
+func (mmUpdate *mTagRepositoryMockUpdate) Expect(ctx context.Context, m models.Tag) *mTagRepositoryMockUpdate {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("TagRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &TagRepositoryMockUpdateExpectation{}
+	}
+
+	mmUpdate.defaultExpectation.params = &TagRepositoryMockUpdateParams{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 TagRepository.Update
+func (mmUpdate *mTagRepositoryMockUpdate) Inspect(f func(ctx context.Context, m models.Tag)) *mTagRepositoryMockUpdate {
+	if mmUpdate.mock.inspectFuncUpdate != nil {
+		mmUpdate.mock.t.Fatalf("Inspect function is already set for TagRepositoryMock.Update")
+	}
+
+	mmUpdate.mock.inspectFuncUpdate = f
+
+	return mmUpdate
+}
+
+// Return sets up results that will be returned by TagRepository.Update
+func (mmUpdate *mTagRepositoryMockUpdate) Return(err error) *TagRepositoryMock {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("TagRepositoryMock.Update mock is already set by Set")
+	}
+
+	if mmUpdate.defaultExpectation == nil {
+		mmUpdate.defaultExpectation = &TagRepositoryMockUpdateExpectation{mock: mmUpdate.mock}
+	}
+	mmUpdate.defaultExpectation.results = &TagRepositoryMockUpdateResults{err}
+	return mmUpdate.mock
+}
+
+// Set uses given function f to mock the TagRepository.Update method
+func (mmUpdate *mTagRepositoryMockUpdate) Set(f func(ctx context.Context, m models.Tag) (err error)) *TagRepositoryMock {
+	if mmUpdate.defaultExpectation != nil {
+		mmUpdate.mock.t.Fatalf("Default expectation is already set for the TagRepository.Update method")
+	}
+
+	if len(mmUpdate.expectations) > 0 {
+		mmUpdate.mock.t.Fatalf("Some expectations are already set for the TagRepository.Update method")
+	}
+
+	mmUpdate.mock.funcUpdate = f
+	return mmUpdate.mock
+}
+
+// When sets expectation for the TagRepository.Update which will trigger the result defined by the following
+// Then helper
+func (mmUpdate *mTagRepositoryMockUpdate) When(ctx context.Context, m models.Tag) *TagRepositoryMockUpdateExpectation {
+	if mmUpdate.mock.funcUpdate != nil {
+		mmUpdate.mock.t.Fatalf("TagRepositoryMock.Update mock is already set by Set")
+	}
+
+	expectation := &TagRepositoryMockUpdateExpectation{
+		mock:   mmUpdate.mock,
+		params: &TagRepositoryMockUpdateParams{ctx, m},
+	}
+	mmUpdate.expectations = append(mmUpdate.expectations, expectation)
+	return expectation
+}
+
+// Then sets up TagRepository.Update return parameters for the expectation previously defined by the When method
+func (e *TagRepositoryMockUpdateExpectation) Then(err error) *TagRepositoryMock {
+	e.results = &TagRepositoryMockUpdateResults{err}
+	return e.mock
+}
+
+// Update implements interfaces.TagRepository
+func (mmUpdate *TagRepositoryMock) 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 := &TagRepositoryMockUpdateParams{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 := TagRepositoryMockUpdateParams{ctx, m}
+		if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
+			mmUpdate.t.Errorf("TagRepositoryMock.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 TagRepositoryMock.Update")
+		}
+		return (*mm_results).err
+	}
+	if mmUpdate.funcUpdate != nil {
+		return mmUpdate.funcUpdate(ctx, m)
+	}
+	mmUpdate.t.Fatalf("Unexpected call to TagRepositoryMock.Update. %v %v", ctx, m)
+	return
+}
+
+// UpdateAfterCounter returns a count of finished TagRepositoryMock.Update invocations
+func (mmUpdate *TagRepositoryMock) UpdateAfterCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.afterUpdateCounter)
+}
+
+// UpdateBeforeCounter returns a count of TagRepositoryMock.Update invocations
+func (mmUpdate *TagRepositoryMock) UpdateBeforeCounter() uint64 {
+	return mm_atomic.LoadUint64(&mmUpdate.beforeUpdateCounter)
+}
+
+// Calls returns a list of arguments used in each call to TagRepositoryMock.Update.
+// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
+func (mmUpdate *mTagRepositoryMockUpdate) Calls() []*TagRepositoryMockUpdateParams {
+	mmUpdate.mutex.RLock()
+
+	argCopy := make([]*TagRepositoryMockUpdateParams, 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 *TagRepositoryMock) 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 *TagRepositoryMock) MinimockUpdateInspect() {
+	for _, e := range m.UpdateMock.expectations {
+		if mm_atomic.LoadUint64(&e.Counter) < 1 {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.Update")
+		} else {
+			m.t.Errorf("Expected call to TagRepositoryMock.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 TagRepositoryMock.Update")
+	}
+}
+
+// MinimockFinish checks that all mocked methods have been called the expected number of times
+func (m *TagRepositoryMock) 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 *TagRepositoryMock) 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 *TagRepositoryMock) minimockDone() bool {
+	done := true
+	return done &&
+		m.MinimockAddDone() &&
+		m.MinimockDeleteDone() &&
+		m.MinimockGetAllDone() &&
+		m.MinimockGetAllUsedDone() &&
+		m.MinimockGetByArticleIDDone() &&
+		m.MinimockGetByIDDone() &&
+		m.MinimockGetByURLDone() &&
+		m.MinimockIsUsedDone() &&
+		m.MinimockUpdateDone()
+}

+ 0 - 7
internal/repositories/table.go

@@ -1,7 +0,0 @@
-package repositories
-
-const (
-	articleTableName    = "article"
-	tagTableName        = "tag"
-	articleTagTableName = "article_tag"
-)

+ 77 - 47
internal/repositories/tag.go

@@ -2,21 +2,24 @@ 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"
+//go:generate minimock -i github.com/dmitriygnatenko/internal/interfaces.TagRepository -o ./mocks/ -s "_minimock.go"
 
 import (
 	"context"
 	"database/sql"
 
+	sq "github.com/Masterminds/squirrel"
 	"github.com/dmitriygnatenko/internal/interfaces"
 	"github.com/dmitriygnatenko/internal/models"
 )
 
+const tagTableName = "tag"
+
 type tagRepository struct {
 	db *sql.DB
 }
 
-func InitTagRepository(db *sql.DB) interfaces.ITagRepository {
+func InitTagRepository(db *sql.DB) interfaces.TagRepository {
 	return tagRepository{db: db}
 }
 
@@ -26,7 +29,7 @@ func (t tagRepository) GetAllUsed(ctx context.Context) ([]models.Tag, error) {
 	query := "SELECT t.id, t.url, t.tag " +
 		"FROM " + articleTagTableName + " at, " + tagTableName + " t " +
 		"WHERE t.id = at.tag_id AND at.article_id IN" +
-		"(SELECT id FROM " + articleTableName + " " + "WHERE is_active = 1) " +
+		"(SELECT id FROM " + articleTableName + " " + "WHERE is_active = true) " +
 		"GROUP BY t.id"
 
 	rows, err := t.db.QueryContext(ctx, query)
@@ -38,11 +41,7 @@ func (t tagRepository) GetAllUsed(ctx context.Context) ([]models.Tag, error) {
 	for rows.Next() {
 		row := models.Tag{}
 
-		err = rows.Scan(
-			&row.ID,
-			&row.URL,
-			&row.Tag,
-		)
+		err = rows.Scan(&row.ID, &row.URL, &row.Tag)
 		if err != nil {
 			return nil, err
 		}
@@ -50,23 +49,28 @@ func (t tagRepository) GetAllUsed(ctx context.Context) ([]models.Tag, error) {
 		res = append(res, row)
 	}
 
-	err = rows.Err()
-	if err != nil {
+	if err = rows.Err(); err != nil {
 		return nil, err
 	}
 
 	return res, nil
 }
 
-func (t tagRepository) GetByURL(ctx context.Context, tag string) (*models.Tag, error) {
-	var res models.Tag
+func (t tagRepository) GetByURL(ctx context.Context, url string) (*models.Tag, error) {
+	query, args, err := sq.Select("id", "url", "tag").
+		From(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"url": url}).
+		Limit(1).
+		ToSql()
+
+	if err != nil {
+		return nil, err
+	}
 
-	query := "SELECT id, url, tag " +
-		"FROM " + tagTableName + " " +
-		"WHERE url = ? " +
-		"LIMIT 1"
+	var res models.Tag
 
-	err := t.db.QueryRowContext(ctx, query, tag).
+	err = t.db.QueryRowContext(ctx, query, args...).
 		Scan(&res.ID, &res.URL, &res.Tag)
 
 	if err != nil {
@@ -77,14 +81,20 @@ func (t tagRepository) GetByURL(ctx context.Context, tag string) (*models.Tag, e
 }
 
 func (t tagRepository) GetByID(ctx context.Context, id int) (*models.Tag, error) {
-	var res models.Tag
+	query, args, err := sq.Select("id", "url", "tag").
+		From(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"id": id}).
+		Limit(1).
+		ToSql()
 
-	query := "SELECT id, url, tag " +
-		"FROM " + tagTableName + " " +
-		"WHERE id = ? " +
-		"LIMIT 1"
+	if err != nil {
+		return nil, err
+	}
 
-	err := t.db.QueryRowContext(ctx, query, id).
+	var res models.Tag
+
+	err = t.db.QueryRowContext(ctx, query, args...).
 		Scan(&res.ID, &res.URL, &res.Tag)
 
 	if err != nil {
@@ -97,9 +107,15 @@ func (t tagRepository) GetByID(ctx context.Context, id int) (*models.Tag, error)
 func (t tagRepository) GetAll(ctx context.Context) ([]models.Tag, error) {
 	var res []models.Tag
 
-	query := "SELECT id, url, tag FROM " + tagTableName
+	query, args, err := sq.Select("id", "url", "tag").
+		From(tagTableName).
+		ToSql()
 
-	rows, err := t.db.QueryContext(ctx, query)
+	if err != nil {
+		return nil, err
+	}
+
+	rows, err := t.db.QueryContext(ctx, query, args...)
 	if err != nil {
 		return nil, err
 	}
@@ -108,11 +124,7 @@ func (t tagRepository) GetAll(ctx context.Context) ([]models.Tag, error) {
 	for rows.Next() {
 		row := models.Tag{}
 
-		err = rows.Scan(
-			&row.ID,
-			&row.URL,
-			&row.Tag,
-		)
+		err = rows.Scan(&row.ID, &row.URL, &row.Tag)
 		if err != nil {
 			return nil, err
 		}
@@ -120,8 +132,7 @@ func (t tagRepository) GetAll(ctx context.Context) ([]models.Tag, error) {
 		res = append(res, row)
 	}
 
-	err = rows.Err()
-	if err != nil {
+	if err = rows.Err(); err != nil {
 		return nil, err
 	}
 
@@ -144,11 +155,7 @@ func (t tagRepository) GetByArticleID(ctx context.Context, id int) ([]models.Tag
 	for rows.Next() {
 		row := models.Tag{}
 
-		err = rows.Scan(
-			&row.ID,
-			&row.URL,
-			&row.Tag,
-		)
+		err = rows.Scan(&row.ID, &row.URL, &row.Tag)
 		if err != nil {
 			return nil, err
 		}
@@ -156,8 +163,7 @@ func (t tagRepository) GetByArticleID(ctx context.Context, id int) ([]models.Tag
 		res = append(res, row)
 	}
 
-	err = rows.Err()
-	if err != nil {
+	if err = rows.Err(); err != nil {
 		return nil, err
 	}
 
@@ -176,26 +182,50 @@ func (t tagRepository) IsUsed(ctx context.Context, id int) (bool, error) {
 	return count > 0, nil
 }
 
-func (t tagRepository) Add(ctx context.Context, m models.Tag) error {
-	query := "INSERT INTO " + tagTableName + " (tag, url) VALUES (?, ?)"
+func (t tagRepository) Add(ctx context.Context, req models.Tag) error {
+	query, args, err := sq.Insert(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Columns("tag", "url").
+		Values(req.Tag, req.URL).
+		ToSql()
 
-	_, err := t.db.ExecContext(ctx, query, m.Tag, m.URL)
+	if err != nil {
+		return err
+	}
+
+	_, err = t.db.ExecContext(ctx, query, args...)
 
 	return err
 }
 
-func (t tagRepository) Update(ctx context.Context, m models.Tag) error {
-	query := "UPDATE " + tagTableName + " SET tag = ?, url = ? WHERE id = ?"
+func (t tagRepository) Update(ctx context.Context, req models.Tag) error {
+	query, args, err := sq.Update(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Set("tag", req.Tag).
+		Set("url", req.URL).
+		Where(sq.Eq{"id": req.ID}).
+		ToSql()
+
+	if err != nil {
+		return err
+	}
 
-	_, err := t.db.ExecContext(ctx, query, m.Tag, m.URL, m.ID)
+	_, err = t.db.ExecContext(ctx, query, args...)
 
 	return err
 }
 
 func (t tagRepository) Delete(ctx context.Context, id int) error {
-	query := "DELETE FROM " + tagTableName + " WHERE id = ?"
+	query, args, err := sq.Delete(tagTableName).
+		PlaceholderFormat(sq.Dollar).
+		Where(sq.Eq{"id": id}).
+		ToSql()
+
+	if err != nil {
+		return err
+	}
 
-	_, err := t.db.ExecContext(ctx, query, id)
+	_, err = t.db.ExecContext(ctx, query, args...)
 
 	return err
 }