PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/V1/trunk/Source/StockTraderRI/StockTraderRI.Modules.Position.Tests/AccountPositionModelFixture.cs

#
C# | 89 lines | 20 code | 16 blank | 53 comment | 0 complexity | d0b0e478e52709bcaf0d2887634b98d1 MD5 | raw file
 1//===============================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation
 4//===============================================================================
 5// Copyright (c) Microsoft Corporation.  All rights reserved.
 6// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 7// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 8// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 9// FITNESS FOR A PARTICULAR PURPOSE.
10//===============================================================================
11// The example companies, organizations, products, domain names,
12// e-mail addresses, logos, people, places, and events depicted
13// herein are fictitious.  No association with any real company,
14// organization, product, domain name, email address, logo, person,
15// places, or events is intended or should be inferred.
16//===============================================================================
17
18using System;
19using System.Text;
20using System.Collections.Generic;
21using System.Linq;
22using Microsoft.VisualStudio.TestTools.UnitTesting;
23using StockTraderRI.Infrastructure.Models;
24using StockTraderRI.Modules.Position.Services;
25
26namespace StockTraderRI.Modules.Position.Tests
27{
28    /// <summary>
29    /// Summary description for AccountPositionModelFixture
30    /// </summary>
31    [TestClass]
32    public class AccountPositionModelFixture
33    {
34        [TestMethod]
35        public void ShouldReturnDefaultPositions()
36        {
37            AccountPositionService model = new AccountPositionService();
38
39            Assert.IsTrue(model.GetAccountPositions().Count > 0, "No account positions returned");
40        }
41
42	
43        //[TestMethod]
44        //public void AddingPositionFiresUpdatedEvent()
45        //{
46        //    AccountPositionService model = new AccountPositionService();
47
48        //    bool modelUpdated = false;
49        //    AccountPosition testAccountPosition = null;
50
51        //    model.Updated += delegate(object sender, AccountPositionModelEventArgs e)
52        //    {
53        //        modelUpdated = true;
54        //        testAccountPosition = e.AcctPosition;
55        //    };
56
57        //    AccountPosition newAccountPosition = new AccountPosition("test", 1.00m, 1);
58        //    model.AddPosition(newAccountPosition);
59
60        //    Assert.IsTrue(modelUpdated);
61        //    Assert.AreSame(testAccountPosition, newAccountPosition);
62
63        //}
64
65        //[TestMethod]
66        //public void UpdatingPositionFiresUpdatedEvent()
67        //{
68        //    AccountPositionService model = new AccountPositionService();
69        //    AccountPosition accountPosition = new AccountPosition("test", 1.00m, 1);
70        //    model.AddPosition(accountPosition);
71
72        //    bool modelUpdated = false;
73        //    AccountPosition updatedAccountPosition = null;
74
75        //    model.Updated += delegate(object sender, AccountPositionModelEventArgs e)
76        //    {
77        //        modelUpdated = true;
78        //        updatedAccountPosition = e.AcctPosition;
79        //    };
80
81        //    accountPosition.Shares += 1;
82        //    accountPosition.CostBasis += .50m;
83
84        //    Assert.IsTrue(modelUpdated);
85        //    Assert.AreSame(updatedAccountPosition, accountPosition);
86        //}
87	
88    }
89}