public void SetMessage(MockType mockType) { var expectedMessage = GetExpectedMessage(mockType); var exception = new MockMissingException(mockType, "Class", "Interface", "Member", "Mock"); Assert.Equal(expectedMessage, exception.Message); }
public void ConstructorSetsProperties() { var exception = new MockMissingException(MockType.PropertyGet, _mockInfo); Assert.Equal(MockType.PropertyGet, exception.MemberType); Assert.Equal("MocklisClassName", exception.MocklisClassName); Assert.Equal("InterfaceName", exception.InterfaceName); Assert.Equal("MemberName", exception.MemberName); Assert.Equal("MemberMockName", exception.MemberMockName); }
public void BeSerializable() { var exception = new MockMissingException(MockType.PropertyGet, _mockInfo); var roundtrippedException = RoundTrip(exception); Assert.NotSame(exception, roundtrippedException); Assert.Equal(exception.MemberType, roundtrippedException.MemberType); Assert.Equal(exception.MocklisClassName, roundtrippedException.MocklisClassName); Assert.Equal(exception.InterfaceName, roundtrippedException.InterfaceName); Assert.Equal(exception.MemberName, roundtrippedException.MemberName); Assert.Equal(exception.MemberMockName, roundtrippedException.MemberMockName); Assert.Equal(exception.Message, roundtrippedException.Message); }