package com.atlassian.stash.internal.notification.usersettings;


import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class SendModeTest {
    @Test
    public void testGetSendMode() throws Exception {
        assertEquals("IMMEDIATE", SendMode.IMMEDIATE.toString());
        assertEquals("BATCHED", SendMode.BATCHED.toString());
    }

    @Test
    public void testFromString() throws Exception {
        assertEquals(SendMode.IMMEDIATE, SendMode.fromString("IMMEDIATE"));
        assertEquals(SendMode.BATCHED, SendMode.fromString("BATCHED"));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testInvalidFromString() throws Exception {
        SendMode.fromString("FOO");
    }
}
