Example #1
0
    public void TestPokitDokException_StringExceptionConstructor()
    {
        WebException innerException = new WebException();

        PokitDokException exception = new PokitDokException("Test Message.", innerException);

        Assert.AreEqual("Test Message.", exception.Message);
    }
Example #2
0
    public void TestPokitDokException_VerifyInnerException()
    {
        WebException innerException = new WebException("Alternative Test Message");

        PokitDokException exception = new PokitDokException("Test Message.", innerException);

        Assert.AreEqual("Test Message.", exception.Message);
        Assert.AreEqual(exception.InnerException, innerException);
    }
Example #3
0
    public void TestPokitDokException_StringConstructorDeSerializable()
    {
        // Arrange
        var originalException = new PokitDokException("Test Message.");
        var buffer            = new byte[4096];
        var ms        = new MemoryStream(buffer);
        var ms2       = new MemoryStream(buffer);
        var formatter = new BinaryFormatter();

        // Act
        formatter.Serialize(ms, originalException);
        var deserializedException = (PokitDokException)formatter.Deserialize(ms2);

        // Assert
        Assert.AreEqual(originalException.Message, deserializedException.Message);
    }
Example #4
0
    public void TestPokitDokException_StringConstructor()
    {
        PokitDokException exception = new PokitDokException("Test Message.");

        Assert.AreEqual("Test Message.", exception.Message);
    }
Example #5
0
    public void TestPokitDokException_DefaultConstructor()
    {
        PokitDokException exception = new PokitDokException();

        Assert.AreEqual("Exception of type 'pokitdokcsharp.PokitDokException' was thrown.", exception.Message);
    }