PageRenderTime 28ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/V2.2/trunk/Quickstarts/MultiTargeting/Silverlight/RealEstateListingViewer.Tests/RealEstateServiceTestFixture.cs

#
C# | 48 lines | 28 code | 4 blank | 16 comment | 0 complexity | 4402ac1f770380c9ac7c6a234ca08d3a MD5 | raw file
 1//===================================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation and Silverlight
 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//===================================================================================
17using Microsoft.VisualStudio.TestTools.UnitTesting;
18using RealEstateListingViewer.Models;
19using RealEstateListingViewer.Services;
20
21namespace RealEstateListingViewer.Tests
22{
23    [TestClass]
24    public class RealEstateServiceTestFixture
25    {
26        [TestMethod]
27        public void CanGetProperty()
28        {
29            RealEstateService target = new RealEstateService();
30
31            RealEstate realEstate = target.GetRealEstate();
32
33            Assert.AreEqual(0.5d, realEstate.Acreage);
34            Assert.AreEqual("132 Main Street", realEstate.Address);
35            Assert.AreEqual("Redmond", realEstate.County);
36            Assert.AreEqual("WA", realEstate.State);
37            Assert.AreEqual(315000d, realEstate.Price);
38            Assert.AreEqual(98052, realEstate.ZipCode);
39            Assert.AreEqual(0.5d, realEstate.Acreage);
40            Assert.AreEqual(2d, realEstate.GarageSize);
41            Assert.AreEqual("This property redefines beauty, with ocean views, mountain views, beach views, tree views, and views of views.  In short it is spectacular.", realEstate.Description);
42            Assert.AreEqual(2.5d, realEstate.Bathrooms);
43            Assert.AreEqual(5d, realEstate.Bedrooms);
44            Assert.AreEqual(2d, realEstate.GarageSize);
45        }
46
47    }
48}