View Javadoc
1   /*
2    * Copyright 2018-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.hardware;
6   
7   import static org.hamcrest.MatcherAssert.assertThat;
8   import static org.hamcrest.Matchers.is;
9   import static org.hamcrest.Matchers.notNullValue;
10  
11  import org.junit.jupiter.api.Test;
12  
13  import oshi.SystemInfo;
14  
15  /**
16   * Test SoundCard
17   */
18  class SoundCardTest {
19  
20      /**
21       * Testing sound cards , each attribute.
22       */
23      @Test
24      void testSoundCards() {
25          SystemInfo info = new SystemInfo();
26          for (SoundCard soundCard : info.getHardware().getSoundCards()) {
27              assertThat("Sound card's codec should not be null", soundCard.getCodec(), is(notNullValue()));
28              assertThat("Sound card's driver should not be null", soundCard.getDriverVersion(), is(notNullValue()));
29              assertThat("Sound card's name should not be null", soundCard.getName(), is(notNullValue()));
30          }
31      }
32  
33  }