Esempio n. 1
0
        public void Constructor_with_1_arg_puts_id_in_message()
        {
            var id = new DummyIdentity {
                Id = "A123"
            };
            var exception = new EntityNotFoundException(id);

            exception.Message.Should().Contain(id.HumanReadableId);
        }
Esempio n. 2
0
        public void Constructor_with_3_arg_puts_id_in_message()
        {
            var id = new DummyIdentity {
                Id = "A123"
            };
            var innerException = new KeyNotFoundException();
            var exception      = new EntityNotFoundException(id, "addendum", innerException);

            exception.Message.Should().Contain(id.HumanReadableId);
            exception.Message.Should().Contain("addendum");
            exception.InnerException.Should().Be(innerException);
        }