 
         XCTAssertEqual(device.name, "Null Audio Device")
         XCTAssertEqual(device.manufacturer, "Apple Inc.")
+        XCTAssertEqual(device.uid, "NullAudioDevice_UID")
         XCTAssertEqual(device.modelUID, "NullAudioDevice_ModelUID")
         XCTAssertEqual(device.configurationApplication, "com.apple.audio.AudioMIDISetup")
         XCTAssertEqual(device.transportType, TransportType.virtual)


        XCTAssertTrue(device.setVirtualMasterVolume(0.0, direction: .playback))
        XCTAssertEqual(device.virtualMasterVolume(direction: .playback), 0.0)
        XCTAssertTrue(device.setVirtualMasterVolume(0.5, direction: .playback))
        XCTAssertEqual(device.virtualMasterVolume(direction: .playback), 0.5)

        XCTAssertTrue(device.setVirtualMasterVolume(0.0, direction: .recording))
        XCTAssertEqual(device.virtualMasterVolume(direction: .recording), 0.0)
        XCTAssertTrue(device.setVirtualMasterVolume(0.5, direction: .recording))
        XCTAssertEqual(device.virtualMasterVolume(direction: .recording), 0.5)
    }

    func testVirtualMasterBalance() throws {

@testable import AMCoreAudio

final class AudioDeviceTests: XCTestCase {
    let defaultOutputDevice = AudioDevice.defaultOutputDevice()
    let defaultInputDevice = AudioDevice.defaultInputDevice()
    let defaultSystemOutputDevice = AudioDevice.defaultSystemOutputDevice()

    override func setUp() {
        super.setUp()

        ResetDefaultDevices()
        try? ResetDeviceState()
    }

    override func tearDown() {
        super.tearDown()

        ResetDefaultDevices()
        try? ResetDeviceState()
    }

    func testDeviceLookUp() throws {
        let device = try GetDevice()
        let deviceUID = try XCTUnwrap(device.uid)

        XCTAssertEqual(AudioDevice.lookup(by: device.id), device)
        XCTAssertEqual(AudioDevice.lookup(by: deviceUID), device)
    }

    func testDeviceEnumeration() throws {
        let device = try GetDevice()

        XCTAssertTrue(AudioDevice.allDevices().contains(device))
        XCTAssertTrue(AudioDevice.allDeviceIDs().contains(device.id))
        XCTAssertTrue(AudioDevice.allInputDevices().contains(device))
        XCTAssertTrue(AudioDevice.allOutputDevices().contains(device))
    }

    func testSettingDefaultDevice() throws {
        let device = try GetDevice()

        XCTAssertTrue(device.setAsDefaultSystemDevice())
        XCTAssertEqual(AudioDevice.defaultSystemOutputDevice(), device)

        XCTAssertTrue(device.setAsDefaultOutputDevice())
        XCTAssertEqual(AudioDevice.defaultOutputDevice(), device)

        XCTAssertTrue(device.setAsDefaultInputDevice())
        XCTAssertEqual(AudioDevice.defaultInputDevice(), device)
    }

    func testGeneralDeviceInformation() throws {
