[mjs] Separate Configuration Data from Code

11 views
Skip to first unread message

Wayne Rasmussen

unread,
Jan 22, 2018, 5:55:26 PM1/22/18
to Zakas Books
My question is on how to use this involves unit testing.

We have our entire application and various classes use certain configuration data.  When it comes time to unit test class Foo,  how to write Foo and use Foo in such a way to test variations on settings that are specifically used by Foo?  Can you provide an example of a Foo class how you would do this as an example is worth 1000 words.

Nicholas Zakas

unread,
Jan 24, 2018, 11:41:43 AM1/24/18
to zakas...@googlegroups.com
I would suggest reading the documentation associated with the unit testing framework you are using. They often have examples of how to do this.
On Mon, Jan 22, 2018 at 3:55 PM Wayne Rasmussen <waynejr...@gmail.com> wrote:
My question is on how to use this involves unit testing.

We have our entire application and various classes use certain configuration data.  When it comes time to unit test class Foo,  how to write Foo and use Foo in such a way to test variations on settings that are specifically used by Foo?  Can you provide an example of a Foo class how you would do this as an example is worth 1000 words.

--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wayne Rasmussen

unread,
Jan 31, 2018, 5:38:38 PM1/31/18
to Zakas Books

Ok,  thanks!
Reply all
Reply to author
Forward
0 new messages