dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/deviceservice_test.go (about)

     1  //
     2  // Copyright (C) 2021 IOTech Ltd
     3  //
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package dtos
     7  
     8  import (
     9  	"testing"
    10  
    11  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/models"
    12  
    13  	"github.com/stretchr/testify/assert"
    14  )
    15  
    16  func TestFromDeviceServiceModelToUpdateDTO(t *testing.T) {
    17  	model := models.DeviceService{}
    18  	dto := FromDeviceServiceModelToUpdateDTO(model)
    19  	assert.Equal(t, model.Id, *dto.Id)
    20  	assert.Equal(t, model.Name, *dto.Name)
    21  	assert.Equal(t, model.Labels, dto.Labels)
    22  	assert.Equal(t, model.Id, *dto.BaseAddress)
    23  	assert.EqualValues(t, model.Id, *dto.AdminState)
    24  }