public void ProduceOfferReturnsCorrectResult(
            string locationName,
            string currentTime)
        {
            // Arrange
            var moqRepo = new MockRepository(MockBehavior.Default);

            var sut = new DateAndLocationMortgageApplicationProcessor
            {
                LocationProvider = moqRepo.Create<ILocationProvider>().Object,
                TimeProvider = moqRepo.Create<ITimeProvider>().Object
            };

            Mock.Get(sut.LocationProvider)
                .Setup(lp => lp.GetCurrentLocationName())
                .Returns(locationName);
            Mock.Get(sut.TimeProvider)
                .Setup(tp => tp.GetCurrentTime())
                .Returns(DateTimeOffset.Parse(currentTime));

            // Act
            var dummyApplication = new MortgageApplication();
            var actual = sut.ProduceOffer(dummyApplication);

            // Assert
            var expected = new IRendering[]
            {
                new TextRendering(
                    locationName +
                    ", " +
                    DateTimeOffset.Parse(currentTime).ToString("D")),
                new LineBreakRendering()
            };
            Assert.Equal(expected, actual);
        }
        public void SutDoesNotEqualAnonymousObject()
        {
            var sut = new DateAndLocationMortgageApplicationProcessor();
            var anonymous = new object();

            var actual = sut.Equals(anonymous);

            Assert.False(actual);
        }
        public void SutDoesNotEqualOtherWithDifferentLocationProvider()
        {
            var moqRepo = new MockRepository(MockBehavior.Default);
            var sut = new DateAndLocationMortgageApplicationProcessor
            {
                LocationProvider = moqRepo.Create<ILocationProvider>().Object,
                TimeProvider = moqRepo.Create<ITimeProvider>().Object
            };
            var other = new DateAndLocationMortgageApplicationProcessor
            {
                LocationProvider = moqRepo.Create<ILocationProvider>().Object,
                TimeProvider = sut.TimeProvider
            };

            var actual = sut.Equals(other);

            Assert.False(actual);
        }
 public void SutIsMortgageApplicationProcessor()
 {
     var sut = new DateAndLocationMortgageApplicationProcessor();
     Assert.IsAssignableFrom<IMortgageApplicationProcessor>(sut);
 }