Exemple #1
0
        public void WhenSecondResponseIsNull_ThenEqualsReturnsFalse()
        {
            var baseCurrency = "BASE";
            var date         = DateTime.UtcNow;

            var response1 = new ExchangeRatesResponse(baseCurrency, date, new Dictionary <string, decimal>());

            response1.Equals(null).Should().BeFalse();
        }
Exemple #2
0
        public void WhenTwoResponsesAreTheSameReference_ThenEqualsReturnsTrue()
        {
            var baseCurrency = "BASE";
            var date         = DateTime.UtcNow;

            var response1 = new ExchangeRatesResponse(baseCurrency, date, new Dictionary <string, decimal>());
            var response2 = response1;

            response1.Equals(response2).Should().BeTrue();
        }
Exemple #3
0
        public void WhenTwoResponsesHaveTheSameBaseAndDate_ThenObjectEqualityIsTrue()
        {
            var baseCurrency = "BASE";
            var date         = DateTime.UtcNow;

            var    response1 = new ExchangeRatesResponse(baseCurrency, date, new Dictionary <string, decimal>());
            object response2 = new ExchangeRatesResponse(baseCurrency, date, new Dictionary <string, decimal>());

            response1.Equals(response2).Should().BeTrue();
        }
Exemple #4
0
        public void WhenResponseIsCheckedForEqualityOfObjectOfDifferentType_ThenReturnsFalse()
        {
            var baseCurrency = "BASE";
            var date         = DateTime.UtcNow;

            var response1 = new ExchangeRatesResponse(baseCurrency, date, new Dictionary <string, decimal>());
            var response2 = (object)"STRING!";

            response1.Equals(response2).Should().BeFalse();
        }
Exemple #5
0
        public void WhenResponseIsCheckedForEqualityOfNullObject_ThenReturnsFalse()
        {
            var baseCurrency = "BASE";
            var date         = DateTime.UtcNow;

            var    response1 = new ExchangeRatesResponse(baseCurrency, date, new Dictionary <string, decimal>());
            object response2 = null;

            response1.Equals(response2).Should().BeFalse();
        }
Exemple #6
0
        public void WhenTwoResponsesDifferOnlyInBase_ThenEqualsReturnsFalse()
        {
            var base1 = "BASE";
            var base2 = "EUR";
            var date  = DateTime.UtcNow;

            var response1 = new ExchangeRatesResponse(base1, date, new Dictionary <string, decimal>());
            var response2 = new ExchangeRatesResponse(base2, date, new Dictionary <string, decimal>());

            response1.Equals(response2).Should().BeFalse();
        }