Skip to content

Commit 42ff9b6

Browse files
author
André Behrens
committed
add junit test for appointment subject
1 parent 95f1840 commit 42ff9b6

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* The MIT License
3+
* Copyright (c) 2012 Microsoft Corporation
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in
13+
* all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
* THE SOFTWARE.
22+
*/
23+
24+
package microsoft.exchange.webservices.data.core.service.items;
25+
26+
import static org.hamcrest.Matchers.equalTo;
27+
import static org.hamcrest.core.Is.is;
28+
import static org.junit.Assert.assertThat;
29+
import static org.mockito.Mockito.doReturn;
30+
import static org.mockito.Mockito.mock;
31+
32+
import microsoft.exchange.webservices.data.core.ExchangeService;
33+
import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion;
34+
import microsoft.exchange.webservices.data.core.service.item.Appointment;
35+
import org.junit.Test;
36+
import org.junit.runner.RunWith;
37+
import org.junit.runners.JUnit4;
38+
39+
40+
/**
41+
* Testclass for methods of Appointment
42+
*/
43+
@RunWith(JUnit4.class)
44+
public class AppointmentTest {
45+
46+
private final ExchangeService exchangeService = mock(ExchangeService.class);
47+
48+
@Test
49+
public void testSetSubject() throws Exception {
50+
doReturn(ExchangeVersion.Exchange2010_SP2).when(exchangeService).getRequestedServerVersion();
51+
52+
Appointment appointment = new Appointment(exchangeService);
53+
54+
final String subject = "Lorem Ipsum";
55+
appointment.setSubject(subject);
56+
57+
assertThat(appointment.getSubject(), is(equalTo(subject)));
58+
}
59+
}

0 commit comments

Comments
 (0)