Package accountService

Source Code of accountService.AccountServiceTest

package accountService;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import messageSystem.AddressSystem;
import messageSystem.MsgSystem;

import org.junit.*;

import com.mysql.jdbc.Connection;

import modules.*;

public class AccountServiceTest {
 
  private MsgSystem messageSystem;
  private AddressSystem addressSystem;

  @Before
  public void setUp() {
    this.messageSystem = mock(MsgSystem.class);
    this.addressSystem = mock(AddressSystem.class);
  }

  @Test
  public void TestAccountService ()  {
    AccountService result = new AccountService(messageSystem, addressSystem);
    assertNotNull(result);
  }
 
  @Test
  public void getConnectionTest () {
    AccountService acs = new AccountService(messageSystem, addressSystem);
    Connection newConnect = (Connection) acs.getConnection();
    assertNull(newConnect);
  }
 
  @Test
  public void getAdressTest ()  {
    AccountService someAccountServices = new AccountService(messageSystem, addressSystem);
    Address result = someAccountServices.getAddress()
    verify (this.addressSystem).getASId();
  }
 

}
TOP

Related Classes of accountService.AccountServiceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.