From df933a7865b1f64f8c02285b90fde56e32dfdb2d Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Tue, 18 Jul 2017 10:06:16 +0100 Subject: [PATCH] Cleaned up files --- .../dotimport/service_moq_test.go | 73 ------------------- .../testpackages/dotimport/service_test.go | 10 --- 2 files changed, 83 deletions(-) delete mode 100755 pkg/moq/testpackages/dotimport/service_moq_test.go delete mode 100644 pkg/moq/testpackages/dotimport/service_test.go diff --git a/pkg/moq/testpackages/dotimport/service_moq_test.go b/pkg/moq/testpackages/dotimport/service_moq_test.go deleted file mode 100755 index 90a010a..0000000 --- a/pkg/moq/testpackages/dotimport/service_moq_test.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by moq; DO NOT EDIT -// github.com/matryer/moq - -package dotimport_test - -import ( - "dotimport" - "sync" -) - -var ( - lockServiceMockUser sync.RWMutex -) - -// ServiceMock is a mock implementation of Service. -// -// func TestSomethingThatUsesService(t *testing.T) { -// -// // make and configure a mocked Service -// mockedService := &ServiceMock{ -// UserFunc: func(ID string) (dotimport.User, error) { -// panic("TODO: mock out the User method") -// }, -// } -// -// // TODO: use mockedService in code that requires Service -// // and then make assertions. -// -// } -type ServiceMock struct { - // UserFunc mocks the User method. - UserFunc func(ID string) (dotimport.User, error) - - // calls tracks calls to the methods. - calls struct { - // User holds details about calls to the User method. - User []struct { - // ID is the ID argument value. - ID string - } - } -} - -// User calls UserFunc. -func (mock *ServiceMock) User(ID string) (dotimport.User, error) { - if mock.UserFunc == nil { - panic("moq: ServiceMock.UserFunc is nil but Service.User was just called") - } - callInfo := struct { - ID string - }{ - ID: ID, - } - lockServiceMockUser.Lock() - mock.calls.User = append(mock.calls.User, callInfo) - lockServiceMockUser.Unlock() - return mock.UserFunc(ID) -} - -// UserCalls gets all the calls that were made to User. -// Check the length with: -// len(mockedService.UserCalls()) -func (mock *ServiceMock) UserCalls() []struct { - ID string -} { - var calls []struct { - ID string - } - lockServiceMockUser.RLock() - calls = mock.calls.User - lockServiceMockUser.RUnlock() - return calls -} diff --git a/pkg/moq/testpackages/dotimport/service_test.go b/pkg/moq/testpackages/dotimport/service_test.go deleted file mode 100644 index 2e017ab..0000000 --- a/pkg/moq/testpackages/dotimport/service_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package dotimport_test - -import "testing" - -func TestServiceMock(t *testing.T) { - // Here I want to use the ServiceMock - - service := ServiceMock{} - -}