package com.sf._02_junit;

import org.junit.Test;

import static org.junit.Assert.*;

public class UserServiceImplTest {
    UserServiceImpl userService = new UserServiceImpl();

    @Test
    public void addUser() {
        userService.addUser(new User(1L,"zhangsan",10));
        userService.addUser(new User(2L,"lisi",15));
        userService.addUser(new User(3L,"wangwu",13));
        System.out.println(userService.map);
    }

    @Test
    public void deleteUser() {
        userService.addUser(new User(1L,"zhangsan",10));
        userService.addUser(new User(2L,"lisi",15));

        userService.deleteUser(1L);
        System.out.println(userService.map);
    }

    @Test
    public void updateUser() {
        userService.addUser(new User(1L,"zhangsan",10));
        userService.addUser(new User(2L,"lisi",15));

        userService.updateUser(new User(1L,"fanjialong",18));
        System.out.println(userService.map);
    }

    @Test
    public void queryUserById() {
        userService.addUser(new User(1L,"zhangsan",10));
        userService.addUser(new User(2L,"lisi",15));

        System.out.println(userService.queryUserById(1L));
    }
}