PageRenderTime 144ms CodeModel.GetById 18ms 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. //===================================================================================
  17. using Microsoft.VisualStudio.TestTools.UnitTesting;
  18. using RealEstateListingViewer.Models;
  19. using RealEstateListingViewer.Services;
  20. namespace RealEstateListingViewer.Tests
  21. {
  22. [TestClass]
  23. public class RealEstateServiceTestFixture
  24. {
  25. [TestMethod]
  26. public void CanGetProperty()
  27. {
  28. RealEstateService target = new RealEstateService();
  29. RealEstate realEstate = target.GetRealEstate();
  30. Assert.AreEqual(0.5d, realEstate.Acreage);
  31. Assert.AreEqual("132 Main Street", realEstate.Address);
  32. Assert.AreEqual("Redmond", realEstate.County);
  33. Assert.AreEqual("WA", realEstate.State);
  34. Assert.AreEqual(315000d, realEstate.Price);
  35. Assert.AreEqual(98052, realEstate.ZipCode);
  36. Assert.AreEqual(0.5d, realEstate.Acreage);
  37. Assert.AreEqual(2d, realEstate.GarageSize);
  38. 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);
  39. Assert.AreEqual(2.5d, realEstate.Bathrooms);
  40. Assert.AreEqual(5d, realEstate.Bedrooms);
  41. Assert.AreEqual(2d, realEstate.GarageSize);
  42. }
  43. }
  44. }