Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.85 KB | None | 0 0
  1. using FurnitureManufacturer.Interfaces;
  2. using FurnitureManufacturer.Models;
  3. using Microsoft.VisualStudio.TestTools.UnitTesting;
  4. using Moq;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Text;
  8.  
  9. namespace FurnitureManufacturer.Tests.CompanyTests
  10. {
  11.     [TestClass]
  12.  
  13.     public class CompanyCatalog_Should
  14.     {
  15.         [TestMethod]
  16.  
  17.         public void ReturnNoIfCompanyDoesNotHaveAnyFurniture()
  18.         {
  19.             var company = new Company("FakeCompany", "1234567890");
  20.  
  21.             var expected = "FakeCompany - 1234567890 - no furnitures";
  22.  
  23.             Assert.AreEqual(expected, company.Catalog());
  24.         }
  25.  
  26.         [TestMethod]
  27.  
  28.         public void NotReturnPluralWhenOneFurnitureIsAdded()
  29.         {
  30.             var company = new Company("FakeCompany", "1234567890");
  31.  
  32.             var fakeFurniture = new Mock<IFurniture>();
  33.             company.Add(fakeFurniture.Object);
  34.            
  35.             var falseOutput = "furnitures";
  36.  
  37.             Assert.IsFalse(company.Catalog().Contains(falseOutput));
  38.         }
  39.  
  40.         [TestMethod]
  41.  
  42.         public void CorrectlyReturnFurnituresWhenTheAmountIsMoreThanOne()
  43.         {
  44.             var company = new Company("FakeCompany", "1234567890");
  45.  
  46.             var fakeFurniture = new Mock<IFurniture>();
  47.             company.Add(fakeFurniture.Object);
  48.             company.Add(fakeFurniture.Object);
  49.             company.Add(fakeFurniture.Object);
  50.  
  51.             var expectedOutput = "furnitures";
  52.  
  53.             Assert.IsTrue(company.Catalog().Contains(expectedOutput));
  54.         }
  55.  
  56.         [TestMethod]
  57.  
  58.         public void CorrectlyReturnTheAmountOfFurnitures()
  59.         {
  60.             var company = new Company("FakeCompany", "1234567890");
  61.  
  62.             var fakeFurniture = new Mock<IFurniture>();
  63.             company.Add(fakeFurniture.Object);
  64.             company.Add(fakeFurniture.Object);
  65.             company.Add(fakeFurniture.Object);
  66.  
  67.             var expectedOutput = "3";
  68.  
  69.             Assert.IsTrue(company.Catalog().Contains(expectedOutput));
  70.         }
  71.  
  72.         [TestMethod]
  73.  
  74.         public void CorrectlyReturnTheNameOfTheCompany()
  75.         {
  76.             var company = new Company("FakeCompany", "1234567890");
  77.  
  78.             var fakeFurniture = new Mock<IFurniture>();
  79.             company.Add(fakeFurniture.Object);
  80.  
  81.             var expectedOutput = "FakeCompany";
  82.  
  83.             Assert.IsTrue(company.Catalog().Contains(expectedOutput));
  84.         }
  85.  
  86.         [TestMethod]
  87.  
  88.         public void CorrectlyReturnTheRegistrationNumberOfTheCompany()
  89.         {
  90.             var company = new Company("FakeCompany", "1234567890");
  91.  
  92.             var fakeFurniture = new Mock<IFurniture>();
  93.             company.Add(fakeFurniture.Object);
  94.  
  95.             var expectedOutput = "1234567890";
  96.  
  97.             Assert.IsTrue(company.Catalog().Contains(expectedOutput));
  98.         }
  99.     }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement