public void PostDealEditsCorrectInfoWhenEditingDeal()
        {
            ///////////////////Arrange///////////////////

            var mockGenRepository = new Mock <IGenericRepository>();

            mockGenRepository.Setup(x => x.Find <Deal>(7)).Returns(new Deal
            {
                Id         = 7,
                DealName   = "Test Deal",
                Amount     = 500000m,
                Stage      = "Qualified to Buy",
                CloseDate  = new DateTime(2015, 4, 27),
                isArchived = false
            });

            var mockDealRepository = new Mock <IDealRepository>();

            var controller = new DealsController(mockGenRepository.Object, mockDealRepository.Object);

            ///////////////////Act///////////////////

            //Should Pass Test
            IHttpActionResult actionResult = controller.PostDeal(new Deal
            {
                Id         = 7,
                DealName   = "Test Deal Change",
                Amount     = 600000m,
                Stage      = "Presentation Scheduled",
                CloseDate  = new DateTime(2015, 3, 24),
                isArchived = true
            });

            var contentResult = actionResult as OkNegotiatedContentResult <Deal>;

            // Assert
            Assert.IsInstanceOfType(actionResult, typeof(UnauthorizedResult));
            //Assert.IsNotNull(contentResult);
            //Assert.IsNotNull(contentResult.Content);
            //Assert.AreEqual(7, contentResult.Content.Id);
            //Assert.AreEqual("Test Deal Change", contentResult.Content.DealName);
            //Assert.AreEqual(600000m, contentResult.Content.Amount);
            //Assert.AreEqual("Presentation Scheduled", contentResult.Content.Stage);
            //Assert.AreEqual(new DateTime(2015, 3, 24), contentResult.Content.CloseDate);
            //Assert.AreEqual(true, contentResult.Content.isArchived);

            //Failed test with unchanged results
            //Assert.AreEqual("Test Deal", contentResult.Content.DealName);
            //Assert.AreEqual(500000m, contentResult.Content.Amount);
            //Assert.AreEqual("Qualified to Buy", contentResult.Content.Stage);
            //Assert.AreEqual(new DateTime(2015, 4, 27), contentResult.Content.CloseDate);
            //Assert.AreEqual(false, contentResult.Content.isArchived);
        }
        public void PostDealSavesCorrectInfoWhenAddingNewDeal()
        {
            ///////////////////Arrange///////////////////

            var mockGenRepository = new Mock <IGenericRepository>();

            var mockDealRepository = new Mock <IDealRepository>();

            var controller = new DealsController(mockGenRepository.Object, mockDealRepository.Object);

            ///////////////////Act///////////////////

            //Should Pass Test
            IHttpActionResult actionResult = controller.PostDeal(new Deal
            {
                Id         = 0,
                DealName   = "Test Deal",
                Amount     = 500000m,
                Stage      = "Qualified to Buy",
                CloseDate  = new DateTime(2015, 4, 27),
                isArchived = false
            });

            var contentResult = actionResult as OkNegotiatedContentResult <Deal>;

            // Assert
            Assert.IsInstanceOfType(actionResult, typeof(UnauthorizedResult));
            //Assert.IsNotNull(contentResult);
            //Assert.IsNotNull(contentResult.Content);
            //Assert.AreEqual(0, contentResult.Content.Id);
            //Assert.AreEqual("Test Deal", contentResult.Content.DealName);
            //Assert.AreEqual(500000m, contentResult.Content.Amount);
            //Assert.AreEqual("Qualified to Buy", contentResult.Content.Stage);
            //Assert.AreEqual(new DateTime(2015, 4, 27), contentResult.Content.CloseDate);
            //Assert.AreEqual(false, contentResult.Content.isArchived);
        }