Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated FizzBuzzWriter to take in IRule rather than DefaultNumberRule

  • Loading branch information...
commit c52ed260d5449680095aba62fd8cd105d618f24c 1 parent 106c8f2
= authored
View
4 FizzbuzzExample/FizzBuzz/FizzBuzzWriter.cs
@@ -10,9 +10,9 @@ public class FizzBuzzWriter
{
private readonly TextWriter _writer;
private readonly List<IRule> _configuration = new List<IRule>();
- private readonly DefaultNumberRule _defaultRule;
+ private readonly IRule _defaultRule;
- public FizzBuzzWriter(TextWriter output, DefaultNumberRule defaultRule)
+ public FizzBuzzWriter(TextWriter output, IRule defaultRule)
{
_writer = output;
_defaultRule = defaultRule;
View
10 FizzbuzzExample/FizzBuzz/Rules/FizzBuzzRule.cs
@@ -1,10 +0,0 @@
-namespace FizzBuzz.Rules
-{
- public class FizzBuzzRule : IRule
- {
- public string Write(int i)
- {
- return i % 3 == 0 && i % 5 == 0 ? "FizzBuzz" : string.Empty;
- }
- }
-}
View
9 FizzbuzzExample/FizzbuzzExample.sln.DotSettings.user
@@ -1,5 +1,8 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/Environment/SearchAndNavigation/MergeOccurences/@EntryValue">False</s:Boolean>
- <s:Boolean x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionPersistentData/=1E52E75324CA40A7914AFDF46C426234/@KeyIndexDefined">True</s:Boolean>
- <s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionPersistentData/=1E52E75324CA40A7914AFDF46C426234/Name/@EntryValue">should_be_able_to_configure_new_rules</s:String>
- <s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionPersistentData/=1E52E75324CA40A7914AFDF46C426234/XmlSerializedElements/@EntryValue">&lt;Session&gt;&lt;Elements&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestFixtureElement" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestFixtureElement" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.RuleTests" type="NUnitTestFixtureElement" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.first_number_to_evaluate_should_be_one" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="first_number_to_evaluate_should_be_one" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.first_number_to_evaluate_should_be_two" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="first_number_to_evaluate_should_be_two" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.last_number_to_evaluate_should_be_one_hundred" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="last_number_to_evaluate_should_be_one_hundred" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_be_able_to_configure_new_rules" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_be_able_to_configure_new_rules" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_match_all_rules_example_1" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_match_all_rules_example_1" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_match_all_rules_example_2" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_match_all_rules_example_2" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.should_provide_a_source_of_numbers_to_iterate_over" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="should_provide_a_source_of_numbers_to_iterate_over" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_buzz_if_number_is_multiple_of_five" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_buzz_if_number_is_multiple_of_five" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_Fizz_if_number_is_mulitple_of_three" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_Fizz_if_number_is_mulitple_of_three" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_fizzbuzz_if_multiple_of_five_and_three" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_fizzbuzz_if_multiple_of_five_and_three" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_number_if_not_multiple" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_number_if_not_multiple" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.RuleTests.when_divisible_by_four_output_bazz" ParentId="Fizzbuzz.Tests.RuleTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.RuleTests" MethodName="when_divisible_by_four_output_bazz" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;/Elements&gt;&lt;/Session&gt;</s:String></wpf:ResourceDictionary>
+ <s:Boolean x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionPersistentData/=D9256EAFED2F482285F747675248B1DC/@KeyIndexDefined">True</s:Boolean>
+ <s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionPersistentData/=D9256EAFED2F482285F747675248B1DC/Name/@EntryValue">NumberSourceTests</s:String>
+ <s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionPersistentData/=D9256EAFED2F482285F747675248B1DC/XmlSerializedElements/@EntryValue">&lt;Session&gt;&lt;Elements&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestFixtureElement" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestFixtureElement" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.RuleTests" type="NUnitTestFixtureElement" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.first_number_to_evaluate_should_be_one" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="first_number_to_evaluate_should_be_one" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.first_number_to_evaluate_should_be_two" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="first_number_to_evaluate_should_be_two" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.last_number_to_evaluate_should_be_one_hundred" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="last_number_to_evaluate_should_be_one_hundred" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_be_able_to_configure_new_rules" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_be_able_to_configure_new_rules" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_match_all_rules_example_1" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_match_all_rules_example_1" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_match_all_rules_example_2" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_match_all_rules_example_2" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.NumberSourceTests.should_provide_a_source_of_numbers_to_iterate_over" ParentId="Fizzbuzz.Tests.NumberSourceTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.NumberSourceTests" MethodName="should_provide_a_source_of_numbers_to_iterate_over" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_buzz_if_number_is_multiple_of_five" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_buzz_if_number_is_multiple_of_five" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_Fizz_if_number_is_mulitple_of_three" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_Fizz_if_number_is_mulitple_of_three" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_fizzbuzz_if_multiple_of_five_and_three" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_fizzbuzz_if_multiple_of_five_and_three" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.FizzBuzzTests.should_write_number_if_not_multiple" ParentId="Fizzbuzz.Tests.FizzBuzzTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.FizzBuzzTests" MethodName="should_write_number_if_not_multiple" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;UnitTestElement Provider="nUnit" Id="Fizzbuzz.Tests.RuleTests.when_divisible_by_four_output_bazz" ParentId="Fizzbuzz.Tests.RuleTests" type="NUnitTestElement" TypeName="Fizzbuzz.Tests.RuleTests" MethodName="when_divisible_by_four_output_bazz" Project="2B9DA13F-1DF7-404F-874E-D3EACB64D466" /&gt;&lt;/Elements&gt;&lt;/Session&gt;</s:String>
+
+
+ </wpf:ResourceDictionary>
Please sign in to comment.
Something went wrong with that request. Please try again.