Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose fields of structure to aid in unit testing #145

Open
AmitKumarDas opened this issue Jun 1, 2020 · 0 comments
Open

expose fields of structure to aid in unit testing #145

AmitKumarDas opened this issue Jun 1, 2020 · 0 comments

Comments

@AmitKumarDas
Copy link
Owner

AmitKumarDas commented Jun 1, 2020

Take for example following structure used in dynamic/clientset/clientset.go file

type Clientset struct {
  config           rest.Config
  discoveryManager *dynamicdiscovery.APIResourceDiscovery
  dynamicClient    dynamic.Interface
}

Above structure does not provide any solution for the packages that depend on above struct during this package' unit tests. It will be easier to test if these fields were public.
Alternate way will be to expose an interface for each & every public method of this struct. However, it does not seem the most idiomatic way to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant