Example #1
0
        public void PrependMessage_UnknownType()
        {
            try {
                throw new NullReferenceException(Original);
            }
            catch (Exception e) {
                var e2 = e.PrependMessage(Prepended);

                AssertAll.Of(
                    e2,
                    Is.Not.Null,
                    Is.TypeOf <NullReferenceException>(),
                    Is.InstanceOf <NullReferenceException>(),
                    Is.AssignableTo <NullReferenceException>(),
                    Has.Property(nameof(e.Message)).StartsWith(Prepended),
                    Has.Property(nameof(e.Message)).EndsWith(Original)
                    );
            }
        }