(t *testing.T)
| 546 | } |
| 547 | |
| 548 | func TestBundleService_AddActive_Success(t *testing.T) { |
| 549 | mockAppService := &MockAppService{} |
| 550 | mockVersionService := &MockVersionService{} |
| 551 | mockEnvironmentService := &MockEnvironmentService{} |
| 552 | mockBundleRepo := &MockBundleRepository{} |
| 553 | service := NewBundleService(mockAppService, mockVersionService, mockEnvironmentService, mockBundleRepo) |
| 554 | |
| 555 | ctx := context.Background() |
| 556 | bundleId := primitive.NewObjectID() |
| 557 | |
| 558 | mockBundleRepo.On("AddActive", ctx, bundleId).Return(nil) |
| 559 | |
| 560 | err := service.AddActive(ctx, bundleId) |
| 561 | |
| 562 | assert.NoError(t, err) |
| 563 | |
| 564 | mockBundleRepo.AssertExpectations(t) |
| 565 | } |
| 566 | |
| 567 | func TestBundleService_AddActive_Error(t *testing.T) { |
| 568 | mockAppService := &MockAppService{} |
nothing calls this directly
no test coverage detected