From d2617845562d7dd6d36a6a4f6e26e3ce146e9d03 Mon Sep 17 00:00:00 2001 From: danielmarbach Date: Mon, 23 Apr 2012 11:24:35 +0200 Subject: [PATCH 01/13] Removed unnecessary stuff --- .../Authentication/AuthenticateTest.cs | 60 ------- .../AuthenticationViewModelTest.cs | 86 ---------- .../ChoosePasswordViewModelTest.cs | 66 ------- .../ChooseUserNameViewModelTest.cs | 60 ------- .../Authentication/SuggestUsernamesTest.cs | 90 ---------- .../ContentViewModelFactoryTest.cs | 74 -------- .../ConductStockTickerContentTest.cs | 89 ---------- .../ManageStocks/DollarConverterTest.cs | 53 ------ .../ManageStocks/GetStockDetailsTest.cs | 100 ----------- .../ManageStocks/RangeToTextConverterTest.cs | 73 -------- .../StockDetailModelToTitleConverterTest.cs | 65 ------- .../StockTicker.Test/StockTicker.Test.csproj | 13 -- .../TestHelpers/FutureExtensions.cs | 30 ---- .../TestHelpers/FutureMock.cs | 39 ----- .../Authentication/Authenticate.cs | 55 ------ .../Authentication/Authentication.Designer.cs | 162 ------------------ .../Authentication/Authentication.resx | 153 ----------------- .../AuthenticationExtensions.cs | 52 ------ .../Authentication/AuthenticationModule.cs | 41 ----- .../AuthenticationStepFactory.cs | 42 ----- .../Authentication/AuthenticationView.xaml | 47 ----- .../Authentication/AuthenticationView.xaml.cs | 33 ---- .../Authentication/AuthenticationViewModel.cs | 67 -------- .../Authentication/ChoosePasswordView.cs | 38 ---- .../Authentication/ChoosePasswordView.xaml | 61 ------- .../Authentication/ChoosePasswordView.xaml.cs | 33 ---- .../Authentication/ChoosePasswordViewModel.cs | 148 ---------------- .../ChoosePasswordViewModelValidator.cs | 66 ------- .../Authentication/ChooseUserNameView.cs | 40 ----- .../Authentication/ChooseUserNameView.xaml | 43 ----- .../Authentication/ChooseUserNameView.xaml.cs | 33 ---- .../Authentication/ChooseUserNameViewModel.cs | 132 -------------- .../Authentication/IAuthenticate.cs | 26 --- .../Authentication/IAuthenticationStep.cs | 27 --- .../IAuthenticationStepFactory.cs | 28 --- .../IChoosePasswordViewModel.cs | 40 ----- .../IChooseUsernameViewModel.cs | 31 ---- .../Authentication/ISuggestUsernames.cs | 26 --- source/StockTicker/Authentication/Secure.cs | 61 ------- .../Authentication/SuggestUsernames.cs | 62 ------- .../Authentication/UserNameChosen.cs | 36 ---- source/StockTicker/ContentViewModelFactory.cs | 49 ------ source/StockTicker/FindStocks/SearchView.xaml | 3 - source/StockTicker/Future.cs | 54 ------ source/StockTicker/GlobalSuppressions.cs | 1 + .../StockTicker/IContentViewModelFactory.cs | 28 --- source/StockTicker/IFutureValue.cs | 26 --- source/StockTicker/IFutureValueSetter.cs | 26 --- .../ManageStocks/ConductStockTickerContent.cs | 55 ------ .../ManageStocks/DollarConverter.cs | 38 ---- .../ManageStocks/GetStockDetails.cs | 61 ------- .../IConductStockTickerContent.cs | 27 --- .../ManageStocks/IGetStockDetails.cs | 27 --- .../ManageStocks/IStockDetailViewModel.cs | 34 ---- .../ManageStocks/ManageStocks.Designer.cs | 162 ------------------ .../ManageStocks/ManageStocks.resx | 153 ----------------- .../ManageStocks/ManageStocksExtensions.cs | 49 ------ .../ManageStocks/ManageStocksModule.cs | 30 ---- .../ManageStocks/RangeToTextConverter.cs | 48 ------ .../StockDetailModelToTitleConverter.cs | 54 ------ .../ManageStocks/StockDetailView.cs | 36 ---- .../ManageStocks/StockDetailView.xaml | 61 ------- .../ManageStocks/StockDetailView.xaml.cs | 33 ---- .../ManageStocks/StockDetailViewModel.cs | 49 ------ source/StockTicker/News/HeadLinesView.xaml | 25 --- source/StockTicker/News/HeadLinesViewModel.cs | 27 --- .../StockTicker/News/INewsContentViewModel.cs | 27 --- source/StockTicker/News/INewsViewModel.cs | 24 --- source/StockTicker/News/Images/Economy.jpg | Bin 25480 -> 0 bytes source/StockTicker/News/Images/NewsPaper.jpg | Bin 79015 -> 0 bytes .../News/Images/PersonalFinance.jpg | Bin 24846 -> 0 bytes source/StockTicker/News/Images/Retirement.jpg | Bin 22139 -> 0 bytes .../News/Images/SpecialReports.jpg | Bin 21191 -> 0 bytes source/StockTicker/News/Images/Spotlight.jpg | Bin 20704 -> 0 bytes source/StockTicker/News/Images/Taxes.jpg | Bin 21273 -> 0 bytes source/StockTicker/News/NewsModule.cs | 40 ----- source/StockTicker/News/NewsView.cs | 32 ---- source/StockTicker/News/NewsView.xaml | 30 ---- source/StockTicker/News/NewsView.xaml.cs | 33 ---- source/StockTicker/News/NewsViewModel.cs | 33 ---- source/StockTicker/News/PromotionView.xaml | 15 -- source/StockTicker/News/PromotionView.xaml.cs | 32 ---- source/StockTicker/News/PromotionViewModel.cs | 27 --- source/StockTicker/StaticContentView.xaml | 11 ++ ...View.xaml.cs => StaticContentView.xaml.cs} | 10 +- ...ViewModel.cs => StaticContentViewModel.cs} | 6 +- source/StockTicker/StockTicker.csproj | 130 +------------- source/StockTicker/StockTickerModule.cs | 1 - source/StockTicker/StockTickerViewModel.cs | 25 +-- .../Validation/ValidationModule.cs | 32 ---- .../Validation/ValidatorFactory.cs | 50 ------ 91 files changed, 26 insertions(+), 4169 deletions(-) delete mode 100644 source/StockTicker.Test/Authentication/AuthenticateTest.cs delete mode 100644 source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs delete mode 100644 source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs delete mode 100644 source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs delete mode 100644 source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs delete mode 100644 source/StockTicker.Test/ContentViewModelFactoryTest.cs delete mode 100644 source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs delete mode 100644 source/StockTicker.Test/ManageStocks/DollarConverterTest.cs delete mode 100644 source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs delete mode 100644 source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs delete mode 100644 source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs delete mode 100644 source/StockTicker.Test/TestHelpers/FutureExtensions.cs delete mode 100644 source/StockTicker.Test/TestHelpers/FutureMock.cs delete mode 100644 source/StockTicker/Authentication/Authenticate.cs delete mode 100644 source/StockTicker/Authentication/Authentication.Designer.cs delete mode 100644 source/StockTicker/Authentication/Authentication.resx delete mode 100644 source/StockTicker/Authentication/AuthenticationExtensions.cs delete mode 100644 source/StockTicker/Authentication/AuthenticationModule.cs delete mode 100644 source/StockTicker/Authentication/AuthenticationStepFactory.cs delete mode 100644 source/StockTicker/Authentication/AuthenticationView.xaml delete mode 100644 source/StockTicker/Authentication/AuthenticationView.xaml.cs delete mode 100644 source/StockTicker/Authentication/AuthenticationViewModel.cs delete mode 100644 source/StockTicker/Authentication/ChoosePasswordView.cs delete mode 100644 source/StockTicker/Authentication/ChoosePasswordView.xaml delete mode 100644 source/StockTicker/Authentication/ChoosePasswordView.xaml.cs delete mode 100644 source/StockTicker/Authentication/ChoosePasswordViewModel.cs delete mode 100644 source/StockTicker/Authentication/ChoosePasswordViewModelValidator.cs delete mode 100644 source/StockTicker/Authentication/ChooseUserNameView.cs delete mode 100644 source/StockTicker/Authentication/ChooseUserNameView.xaml delete mode 100644 source/StockTicker/Authentication/ChooseUserNameView.xaml.cs delete mode 100644 source/StockTicker/Authentication/ChooseUserNameViewModel.cs delete mode 100644 source/StockTicker/Authentication/IAuthenticate.cs delete mode 100644 source/StockTicker/Authentication/IAuthenticationStep.cs delete mode 100644 source/StockTicker/Authentication/IAuthenticationStepFactory.cs delete mode 100644 source/StockTicker/Authentication/IChoosePasswordViewModel.cs delete mode 100644 source/StockTicker/Authentication/IChooseUsernameViewModel.cs delete mode 100644 source/StockTicker/Authentication/ISuggestUsernames.cs delete mode 100644 source/StockTicker/Authentication/Secure.cs delete mode 100644 source/StockTicker/Authentication/SuggestUsernames.cs delete mode 100644 source/StockTicker/Authentication/UserNameChosen.cs delete mode 100644 source/StockTicker/ContentViewModelFactory.cs delete mode 100644 source/StockTicker/Future.cs delete mode 100644 source/StockTicker/IContentViewModelFactory.cs delete mode 100644 source/StockTicker/IFutureValue.cs delete mode 100644 source/StockTicker/IFutureValueSetter.cs delete mode 100644 source/StockTicker/ManageStocks/ConductStockTickerContent.cs delete mode 100644 source/StockTicker/ManageStocks/DollarConverter.cs delete mode 100644 source/StockTicker/ManageStocks/GetStockDetails.cs delete mode 100644 source/StockTicker/ManageStocks/IConductStockTickerContent.cs delete mode 100644 source/StockTicker/ManageStocks/IGetStockDetails.cs delete mode 100644 source/StockTicker/ManageStocks/IStockDetailViewModel.cs delete mode 100644 source/StockTicker/ManageStocks/ManageStocks.Designer.cs delete mode 100644 source/StockTicker/ManageStocks/ManageStocks.resx delete mode 100644 source/StockTicker/ManageStocks/ManageStocksExtensions.cs delete mode 100644 source/StockTicker/ManageStocks/ManageStocksModule.cs delete mode 100644 source/StockTicker/ManageStocks/RangeToTextConverter.cs delete mode 100644 source/StockTicker/ManageStocks/StockDetailModelToTitleConverter.cs delete mode 100644 source/StockTicker/ManageStocks/StockDetailView.cs delete mode 100644 source/StockTicker/ManageStocks/StockDetailView.xaml delete mode 100644 source/StockTicker/ManageStocks/StockDetailView.xaml.cs delete mode 100644 source/StockTicker/ManageStocks/StockDetailViewModel.cs delete mode 100644 source/StockTicker/News/HeadLinesView.xaml delete mode 100644 source/StockTicker/News/HeadLinesViewModel.cs delete mode 100644 source/StockTicker/News/INewsContentViewModel.cs delete mode 100644 source/StockTicker/News/INewsViewModel.cs delete mode 100644 source/StockTicker/News/Images/Economy.jpg delete mode 100644 source/StockTicker/News/Images/NewsPaper.jpg delete mode 100644 source/StockTicker/News/Images/PersonalFinance.jpg delete mode 100644 source/StockTicker/News/Images/Retirement.jpg delete mode 100644 source/StockTicker/News/Images/SpecialReports.jpg delete mode 100644 source/StockTicker/News/Images/Spotlight.jpg delete mode 100644 source/StockTicker/News/Images/Taxes.jpg delete mode 100644 source/StockTicker/News/NewsModule.cs delete mode 100644 source/StockTicker/News/NewsView.cs delete mode 100644 source/StockTicker/News/NewsView.xaml delete mode 100644 source/StockTicker/News/NewsView.xaml.cs delete mode 100644 source/StockTicker/News/NewsViewModel.cs delete mode 100644 source/StockTicker/News/PromotionView.xaml delete mode 100644 source/StockTicker/News/PromotionView.xaml.cs delete mode 100644 source/StockTicker/News/PromotionViewModel.cs create mode 100644 source/StockTicker/StaticContentView.xaml rename source/StockTicker/{News/HeadLinesView.xaml.cs => StaticContentView.xaml.cs} (78%) rename source/StockTicker/{Authentication/IAuthenticationViewModel.cs => StaticContentViewModel.cs} (81%) delete mode 100644 source/StockTicker/Validation/ValidationModule.cs delete mode 100644 source/StockTicker/Validation/ValidatorFactory.cs diff --git a/source/StockTicker.Test/Authentication/AuthenticateTest.cs b/source/StockTicker.Test/Authentication/AuthenticateTest.cs deleted file mode 100644 index 782b9b0..0000000 --- a/source/StockTicker.Test/Authentication/AuthenticateTest.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System.Dynamic; - - using Caliburn.Micro; - - using Moq; - - using StockTicker.TestHelpers; - using Xunit; - - public class AuthenticateTest - { - private readonly Mock authenticationViewModel; - - private readonly Mock windowManager; - - private readonly Authenticate testee; - - public AuthenticateTest() - { - this.authenticationViewModel = new Mock(); - this.windowManager = new Mock(); - - this.testee = new Authenticate(this.windowManager.Object, this.authenticationViewModel.Object); - } - - [Fact] - public void ShouldRaiseCompleted() - { - this.testee.ShouldRaiseCompleted(); - } - - [Fact] - public void ShouldOpenAuthenticationWizard() - { - this.testee.Execute(new ActionExecutionContext()); - - this.windowManager.Verify(w => w.ShowDialog(this.authenticationViewModel.Object, null, It.IsAny())); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs b/source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs deleted file mode 100644 index 35e1d24..0000000 --- a/source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs +++ /dev/null @@ -1,86 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System.Collections.Generic; - using Caliburn.Micro; - using FluentAssertions; - using Moq; - - using StockTicker.Actions; - - using Xunit; - - public class AuthenticationViewModelTest - { - private readonly Mock authenticationStepFactory; - - private readonly AuthenticationViewModel testee; - - public AuthenticationViewModelTest() - { - this.authenticationStepFactory = new Mock(); - - this.testee = new AuthenticationViewModel(this.authenticationStepFactory.Object, Mock.Of()); - } - - [Fact] - public void ShouldInitializeWizardSteps() - { - var firstStep = new FakeStep(); - var secondStep = new FakeStep(); - - this.authenticationStepFactory.SetupSequence(f => f.CreateSteps()).Returns( - new List { firstStep, secondStep }); - - this.testee.As().Activate(); - - this.testee.Items.Should().HaveCount(2) - .And.HaveElementAt(0, firstStep) - .And.HaveElementAt(1, secondStep); - - this.testee.ActiveItem.Should().Be(firstStep); - } - - [Fact] - public void Next_ShouldMoveToNextStep() - { - var firstStep = new FakeStep(); - var secondStep = new FakeStep(); - - this.authenticationStepFactory.SetupSequence(f => f.CreateSteps()).Returns( - new List { firstStep, secondStep }); - - this.Activate(); - - this.testee.Next(); - - this.testee.ActiveItem.Should().Be(secondStep); - } - - private void Activate() - { - this.testee.As().Activate(); - } - - private class FakeStep : Screen, IAuthenticationStep - { - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs b/source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs deleted file mode 100644 index 3c9cddd..0000000 --- a/source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System.Security; - - using FluentAssertions.EventMonitoring; - - using FluentValidation; - - using Moq; - - using Xunit; - - public class ChoosePasswordViewModelTest - { - private readonly Mock validatorFactory; - - private readonly ChoosePasswordViewModel testee; - - public ChoosePasswordViewModelTest() - { - this.validatorFactory = new Mock(); - - this.testee = new ChoosePasswordViewModel(this.validatorFactory.Object); - } - - [Fact] - public void Password_ShouldRaisePropertyChanged() - { - this.testee.MonitorEvents(); - - this.testee.Password = new SecureString(); - - this.testee.ShouldRaisePropertyChangeFor(t => t.Password); - this.testee.ShouldRaisePropertyChangeFor(t => t.PasswordRetype); - } - - [Fact] - public void PasswordRetype_ShouldRaisePropertyChanged() - { - this.testee.MonitorEvents(); - - this.testee.PasswordRetype = new SecureString(); - - this.testee.ShouldRaisePropertyChangeFor(t => t.PasswordRetype); - this.testee.ShouldRaisePropertyChangeFor(t => t.Password); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs b/source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs deleted file mode 100644 index a7525ae..0000000 --- a/source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using Caliburn.Micro; - - using FluentAssertions; - using FluentAssertions.EventMonitoring; - - using Moq; - - using Xunit; - - public class ChooseUserNameViewModelTest - { - private readonly ChooseUserNameViewModel testee; - - public ChooseUserNameViewModelTest() - { - this.testee = new ChooseUserNameViewModel(); - } - - [Fact] - public void UserName_ShouldRaisePropertyChanged() - { - this.testee.MonitorEvents(); - - this.testee.UserName = "AnyName"; - - this.testee.ShouldRaisePropertyChangeFor(t => t.UserName); - } - - [Fact] - public void ShouldRaisePropertyChangedForHasSuggestions() - { - this.testee.MonitorEvents(); - - this.testee.Suggestions.Add("AnySuggestion"); - - this.testee.ShouldRaisePropertyChangeFor(x => x.HasSuggestions); - this.testee.HasSuggestions.Should().BeTrue(); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs b/source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs deleted file mode 100644 index 8487990..0000000 --- a/source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs +++ /dev/null @@ -1,90 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System.Collections.Generic; - - using Caliburn.Micro; - - using FluentAssertions; - - using Moq; - - using StockTicker.Actions; - using StockTicker.Externals; - using StockTicker.TestHelpers; - - using Xunit; - - public class SuggestUsernamesTest - { - private readonly Mock authenticationService; - - private readonly PotentialNewUserModel potentialNewUser; - - private readonly SuggestUsernames testee; - - private readonly List suggestions; - - public SuggestUsernamesTest() - { - this.authenticationService = new Mock(); - this.potentialNewUser = new PotentialNewUserModel("AnyFirstname", "AnyLastname"); - this.suggestions = new List(); - - this.testee = new SuggestUsernames(this.authenticationService.Object, this.potentialNewUser, this.suggestions); - } - - [Fact] - public void ShouldRaiseCompleted() - { - this.testee.ShouldRaiseCompleted(); - } - - [Fact] - public void ShouldRequestAsynchronousExecution() - { - this.testee.Should().BeDecoratedWith(); - } - - [Fact] - public void ShouldFillFoundStocks() - { - var expectedSearchModels = new List { "First", "Second", }; - - this.authenticationService.Setup(s => s.SuggestUsernames(this.potentialNewUser)) - .Returns(expectedSearchModels); - - this.testee.Execute(new ActionExecutionContext()); - - this.suggestions.Should().BeEquivalentTo(expectedSearchModels); - } - - [Fact] - public void ShouldClearInputCollection() - { - this.suggestions.Add("First"); - this.suggestions.Add("Second"); - - this.testee.Execute(new ActionExecutionContext()); - - this.suggestions.Should().BeEmpty(); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/ContentViewModelFactoryTest.cs b/source/StockTicker.Test/ContentViewModelFactoryTest.cs deleted file mode 100644 index 4b5be4a..0000000 --- a/source/StockTicker.Test/ContentViewModelFactoryTest.cs +++ /dev/null @@ -1,74 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker -{ - using System; - - using FluentAssertions; - - using Moq; - - using Ninject; - - using StockTicker.Externals; - using StockTicker.ManageStocks; - using StockTicker.News; - - using Xunit; - - public class ContentViewModelFactoryTest : IDisposable - { - private readonly StandardKernel kernel; - - private readonly ContentViewModelFactory testee; - - public ContentViewModelFactoryTest() - { - this.kernel = new StandardKernel(new NinjectSettings { LoadExtensions = false }); - this.kernel.Bind().ToConstant(Mock.Of()); - this.kernel.Bind().ToConstant(Mock.Of()); - - this.testee = new ContentViewModelFactory(this.kernel); - } - - [Fact] - public void ShouldReturnNewsViewModelAsDefaultContent() - { - IStockTickerContentViewModel result = this.testee.CreateContent(null); - - result.Should().NotBeNull() - .And.BeAssignableTo(); - } - - [Fact] - public void ShouldReturnDetailsViewModelForSearchedContent() - { - IStockTickerContentViewModel result = - this.testee.CreateContent(new AnyStockDetailModel()); - - result.Should().NotBeNull() - .And.BeAssignableTo(); - } - - public void Dispose() - { - this.kernel.Dispose(); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs b/source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs deleted file mode 100644 index 4f4ba3b..0000000 --- a/source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs +++ /dev/null @@ -1,89 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.ManageStocks -{ - using Caliburn.Micro; - - using FluentAssertions; - - using Moq; - - using StockTicker.Externals; - using StockTicker.TestHelpers; - - using Xunit; - - public class ConductStockTickerContentTest - { - private readonly FutureMock searchModel; - - private readonly Mock contentFactory; - - private IStockTickerContentViewModel detail; - - public ConductStockTickerContentTest() - { - this.searchModel = new AnyStockDetailModel().AsFuture(); - this.contentFactory = new Mock(); - } - - [Fact] - public void ShouldRaiseCompleted() - { - ConductStockTickerContent testee = this.CreateTestee(); - - testee.ShouldRaiseCompleted(); - } - - [Fact] - public void ShouldAllowNullSearchModel() - { - var future = new FutureMock(); - - ConductStockTickerContent testee = this.CreateTestee(future); - - System.Action act = () => testee.Execute(new ActionExecutionContext()); - - act.ShouldNotThrow(); - } - - [Fact] - public void ShouldConductCreatedDetailViewModel() - { - var contentViewModel = Mock.Of(); - this.contentFactory.Setup(f => f.CreateContent(It.IsAny())).Returns(contentViewModel); - - var testee = this.CreateTestee(); - - testee.Execute(new ActionExecutionContext()); - - this.detail.Should().Be(contentViewModel); - } - - private ConductStockTickerContent CreateTestee(FutureMock search) - { - return new ConductStockTickerContent(search, d => this.detail = d, this.contentFactory.Object); - } - - private ConductStockTickerContent CreateTestee() - { - return this.CreateTestee(this.searchModel); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/ManageStocks/DollarConverterTest.cs b/source/StockTicker.Test/ManageStocks/DollarConverterTest.cs deleted file mode 100644 index 5c46516..0000000 --- a/source/StockTicker.Test/ManageStocks/DollarConverterTest.cs +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.ManageStocks -{ - using System; - using System.Globalization; - - using FluentAssertions; - - using Xunit; - - public class DollarConverterTest - { - private readonly DollarConverter testee; - - public DollarConverterTest() - { - this.testee = new DollarConverter(); - } - - [Fact] - public void ShouldNotConvertBack() - { - Action act = () => this.testee.ConvertBack(null, null, null, null); - - act.ShouldThrow(); - } - - [Fact] - public void ShouldAppendDollar() - { - var result = this.testee.Convert(10.00m, null, null, CultureInfo.InvariantCulture); - - result.As().Should().NotBeNull().And.Be("$10.00"); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs b/source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs deleted file mode 100644 index bf5cf8e..0000000 --- a/source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs +++ /dev/null @@ -1,100 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.ManageStocks -{ - using System; - - using Caliburn.Micro; - - using FluentAssertions; - - using Moq; - - using StockTicker.Actions; - using StockTicker.Externals; - using StockTicker.TestHelpers; - - using Xunit; - - using Action = System.Action; - - public class GetStockDetailsTest - { - private readonly Mock stockService; - - private readonly string symbol; - - private readonly FutureMock detail; - - public GetStockDetailsTest() - { - this.symbol = "AnySymbol"; - this.detail = new FutureMock(); - - this.stockService = new Mock(); - } - - [Fact] - public void ShouldNotAllowNullSearchModel() - { - Action act = () => this.CreateTestee(null); - - act.ShouldThrow(); - } - - [Fact] - public void ShouldRaiseCompleted() - { - var testee = this.CreateTestee(); - - testee.ShouldRaiseCompleted(); - } - - [Fact] - public void ShouldRequestAsynchronousExecution() - { - var testee = this.CreateTestee(); - - testee.Should().BeDecoratedWith(); - } - - [Fact] - public void ShouldReturnDetails() - { - var expectedDetail = new AnyStockDetailModel(); - this.stockService.Setup(s => s.Get(this.symbol)).Returns(expectedDetail); - - var testee = this.CreateTestee(); - - testee.Execute(new ActionExecutionContext()); - - this.detail.Value.Should().Be(expectedDetail); - } - - private GetStockDetails CreateTestee() - { - return this.CreateTestee(this.symbol); - } - - private GetStockDetails CreateTestee(string symbol) - { - return new GetStockDetails(this.stockService.Object, symbol, this.detail); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs b/source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs deleted file mode 100644 index 35fe091..0000000 --- a/source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.ManageStocks -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Globalization; - - using FluentAssertions; - - using StockTicker.Externals; - - using Xunit; - using Xunit.Extensions; - - public class RangeToTextConverterTest - { - private readonly RangeToTextConverter testee; - - public RangeToTextConverterTest() - { - this.testee = new RangeToTextConverter(); - } - - [Fact] - public void ShouldNotConvertBack() - { - Action act = () => this.testee.ConvertBack(null, null, null, null); - - act.ShouldThrow(); - } - - [Theory] - [ClassData(typeof(RangeData))] - public void ShouldConvertRange(decimal @from, decimal to, string expected) - { - var result = this.testee.Convert(new Range(from, to), null, null, CultureInfo.InvariantCulture); - - result.As().Should().NotBeNull().And.Be(expected); - } - - private class RangeData : IEnumerable - { - public IEnumerator GetEnumerator() - { - yield return new object[] { 10.00m, 11.05m, "$10.00 - $11.05" }; - yield return new object[] { -10.00m, 11.05m, "$-10.00 - $11.05" }; - } - - IEnumerator IEnumerable.GetEnumerator() - { - return this.GetEnumerator(); - } - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs b/source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs deleted file mode 100644 index f1739c6..0000000 --- a/source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.ManageStocks -{ - using System; - using System.Globalization; - - using FluentAssertions; - - using StockTicker.Externals; - - using Xunit; - - public class StockDetailModelToTitleConverterTest - { - private readonly StockDetailModelToTitleConverter testee; - - public StockDetailModelToTitleConverterTest() - { - this.testee = new StockDetailModelToTitleConverter(); - } - - [Fact] - public void ShouldNotConvertBack() - { - Action act = () => this.testee.ConvertBack(null, null, null, null); - - act.ShouldThrow(); - } - - [Fact] - public void ShouldConvertOnlySearchDetailModel() - { - object result = this.testee.Convert(new object(), null, null, CultureInfo.InvariantCulture); - - result.Should().BeNull(); - } - - [Fact] - public void ShouldConvertSearchDetailModel() - { - var expected = new AnyStockDetailModel(); - - object result = this.testee.Convert(expected, null, null, CultureInfo.InvariantCulture); - - result.As().Should().NotBeNull().And.Be("AnyCompany\r\nAnyFund:AnySymbol"); - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/StockTicker.Test.csproj b/source/StockTicker.Test/StockTicker.Test.csproj index 317b991..09db03f 100644 --- a/source/StockTicker.Test/StockTicker.Test.csproj +++ b/source/StockTicker.Test/StockTicker.Test.csproj @@ -48,22 +48,11 @@ - - - - - - - - - - - @@ -75,8 +64,6 @@ - - diff --git a/source/StockTicker.Test/TestHelpers/FutureExtensions.cs b/source/StockTicker.Test/TestHelpers/FutureExtensions.cs deleted file mode 100644 index 52988a4..0000000 --- a/source/StockTicker.Test/TestHelpers/FutureExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.TestHelpers -{ - public static class FutureExtensions - { - public static FutureMock AsFuture(this TValue value) - { - var future = new FutureMock(); - future.SetValue(value); - return future; - } - } -} \ No newline at end of file diff --git a/source/StockTicker.Test/TestHelpers/FutureMock.cs b/source/StockTicker.Test/TestHelpers/FutureMock.cs deleted file mode 100644 index af65dd3..0000000 --- a/source/StockTicker.Test/TestHelpers/FutureMock.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.TestHelpers -{ - public sealed class FutureMock : IFutureValueSetter, IFutureValue - { - public FutureMock() - { - } - - public FutureMock(TValue value) - { - this.SetValue(value); - } - - public TValue Value { get; private set; } - - public void SetValue(TValue value) - { - this.Value = value; - } - } -} \ No newline at end of file diff --git a/source/StockTicker/Authentication/Authenticate.cs b/source/StockTicker/Authentication/Authenticate.cs deleted file mode 100644 index 760041a..0000000 --- a/source/StockTicker/Authentication/Authenticate.cs +++ /dev/null @@ -1,55 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System; - using System.Dynamic; - using System.Windows; - using System.Windows.Controls.Primitives; - - using Caliburn.Micro; - - // NOTE: IResult which opens a dialog window with dynamic placement on the screen. The window manager takes care of all the rest. - internal class Authenticate : IAuthenticate - { - private readonly IWindowManager windowManager; - - private readonly IAuthenticationViewModel authenticationViewModel; - - public Authenticate(IWindowManager windowManager, IAuthenticationViewModel authenticationViewModel) - { - this.windowManager = windowManager; - this.authenticationViewModel = authenticationViewModel; - } - - public event EventHandler Completed = delegate { }; - - public void Execute(ActionExecutionContext context) - { - dynamic settings = new ExpandoObject(); - settings.Placement = PlacementMode.Center; - settings.ResizeMode = ResizeMode.NoResize; - settings.ShowInTaskbar = false; - - this.windowManager.ShowDialog(this.authenticationViewModel, null, settings); - - this.Completed(this, new ResultCompletionEventArgs()); - } - } -} \ No newline at end of file diff --git a/source/StockTicker/Authentication/Authentication.Designer.cs b/source/StockTicker/Authentication/Authentication.Designer.cs deleted file mode 100644 index 945b8a5..0000000 --- a/source/StockTicker/Authentication/Authentication.Designer.cs +++ /dev/null @@ -1,162 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.261 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace StockTicker.Authentication { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Authentication { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Authentication() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StockTicker.Authentication.Authentication", typeof(Authentication).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Authentication. - /// - internal static string AuthenticationTitle { - get { - return ResourceManager.GetString("AuthenticationTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Let's choose your password. - /// - internal static string ChoosePassword { - get { - return ResourceManager.GetString("ChoosePassword", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Let's choose your username. - /// - internal static string ChooseUserName { - get { - return ResourceManager.GetString("ChooseUserName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to First name. - /// - internal static string FirstName { - get { - return ResourceManager.GetString("FirstName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to How about one of these?. - /// - internal static string HowAbout { - get { - return ResourceManager.GetString("HowAbout", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Last name. - /// - internal static string LastName { - get { - return ResourceManager.GetString("LastName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Create a password. - /// - internal static string Password { - get { - return ResourceManager.GetString("Password", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Retyped password must match!. - /// - internal static string PasswordRetypeDoesNotMatch { - get { - return ResourceManager.GetString("PasswordRetypeDoesNotMatch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pick a username. - /// - internal static string PickUserName { - get { - return ResourceManager.GetString("PickUserName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fetching suggestion.... - /// - internal static string Suggestion { - get { - return ResourceManager.GetString("Suggestion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to User name. - /// - internal static string UserName { - get { - return ResourceManager.GetString("UserName", resourceCulture); - } - } - } -} diff --git a/source/StockTicker/Authentication/Authentication.resx b/source/StockTicker/Authentication/Authentication.resx deleted file mode 100644 index 65c7cb8..0000000 --- a/source/StockTicker/Authentication/Authentication.resx +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Authentication - - - Let's choose your password - - - Let's choose your username - - - First name - - - How about one of these? - - - Last name - - - Create a password - - - Retyped password must match! - - - Pick a username - - - Fetching suggestion... - - - User name - - \ No newline at end of file diff --git a/source/StockTicker/Authentication/AuthenticationExtensions.cs b/source/StockTicker/Authentication/AuthenticationExtensions.cs deleted file mode 100644 index a884e3d..0000000 --- a/source/StockTicker/Authentication/AuthenticationExtensions.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System; - using System.Collections.Generic; - - using StockTicker.Actions; - using StockTicker.Externals; - - // NOTE: Provides not only smarter syntax for actions but also some convenience mapping methods which could also be achieved with tools like AutoMapper. - internal static class AuthenticationExtensions - { - public static IActionBuilder WithLogin(this IActionBuilder builder, Action configure) - { - return builder.ScopeWith(configure); - } - - public static IActionBuilder SuggestUsernames(this IActionBuilder builder, PotentialNewUserModel potentialNewUser, ICollection suggestedUsernames) - { - return builder.Execute(new { potentialNewUser, suggestedUsernames }); - } - - public static UserNameChosen ToUserNameChosen(this IChooseUserNameViewModel chooseUserNameViewModel) - { - return new UserNameChosen(chooseUserNameViewModel.FirstName, chooseUserNameViewModel.LastName, chooseUserNameViewModel.UserName); - } - - public static void FromChosenUserName(this IChoosePasswordViewModel choosePasswordViewModel, UserNameChosen message) - { - choosePasswordViewModel.FirstName = message.FirstName; - choosePasswordViewModel.LastName = message.LastName; - choosePasswordViewModel.UserName = message.UserName; - } - } -} \ No newline at end of file diff --git a/source/StockTicker/Authentication/AuthenticationModule.cs b/source/StockTicker/Authentication/AuthenticationModule.cs deleted file mode 100644 index a2af990..0000000 --- a/source/StockTicker/Authentication/AuthenticationModule.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using FluentValidation; - - using Ninject.Modules; - - using StockTicker.Extensions; - - public class AuthenticationModule : NinjectModule - { - public override void Load() - { - this.Bind().To(); - - this.Bind().To().RegisterOnEventAggregator(); - this.Bind().To().RegisterOnEventAggregator(); - - this.Bind().To().InSingletonScope(); - - this.Bind>().To(); - } - } -} \ No newline at end of file diff --git a/source/StockTicker/Authentication/AuthenticationStepFactory.cs b/source/StockTicker/Authentication/AuthenticationStepFactory.cs deleted file mode 100644 index 7f0835a..0000000 --- a/source/StockTicker/Authentication/AuthenticationStepFactory.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------- -// -// Copyright (c) 2012 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------- - -namespace StockTicker.Authentication -{ - using System.Collections.Generic; - - using Ninject; - using Ninject.Syntax; - - // NOTE: Concrete step factory which knows how the wizard steps are composed. - internal class AuthenticationStepFactory : IAuthenticationStepFactory - { - private readonly IResolutionRoot resolutionRoot; - - public AuthenticationStepFactory(IResolutionRoot resolutionRoot) - { - this.resolutionRoot = resolutionRoot; - } - - public IEnumerable CreateSteps() - { - yield return this.resolutionRoot.Get(); - yield return this.resolutionRoot.Get(); - } - } -} \ No newline at end of file diff --git a/source/StockTicker/Authentication/AuthenticationView.xaml b/source/StockTicker/Authentication/AuthenticationView.xaml deleted file mode 100644 index ceb6cbf..0000000 --- a/source/StockTicker/Authentication/AuthenticationView.xaml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -