This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,274 @@
using DTS.Common.Classes.Channels;
using DTS.Common.Classes.TestSetups;
using DTS.Common.Interface.Channels;
using DTS.Common.Interface.TestSetups.TestSetupsList;
using NUnit.Framework;
using System;
using System.Linq;
using System.Collections.Generic;
namespace DatabaseUnitTesting
{
[TestFixture]
public partial class DBAPITests
{
public ITestSetupRecord CreateFakeTestSetup()
{
var record = new TestSetupRecord();
record.Id = -1;
record.Name = Guid.NewGuid().ToString().Substring(0, 15);
record.LastModified = DateTime.Today;
record.LastModifiedBy = "NUNIT";
record.TestEngineerDetails = Guid.NewGuid().ToString().Substring(0, 15);
record.CustomerDetails = Guid.NewGuid().ToString().Substring(0, 15);
record.LabDetails = Guid.NewGuid().ToString().Substring(0, 15);
record.Settings = "";
return record;
}
/// <summary>
/// As of database Version 92, TestSetupGet() can now be used to test
/// Version 91 databases, as well as interoperability with Version 92 databases,
/// depending on which is database is present at "...\db\DataPRO.mdf.
/// </summary>
[Test]
public void TestSetupGet()
{
if (!_setup) { Setup(); }
TestLogin();
var connections = DbAPI.DbAPI.Connections.GetActiveConnections();
//we'll insert two records, one which is the one we'll be testing with get, and one that is just a decoy
//for tests which we do not expect to be returned, etc.
var recordToInsert = CreateFakeTestSetup();
var decoyRecord = CreateFakeTestSetup();
var hr = DbAPI.DbAPI.TestSetups.TestSetupsUpdateInsert(_user, connections[0], 0, ref recordToInsert);
Assert.IsTrue(0 == hr, "Should be able to insert a test setup");
hr = DbAPI.DbAPI.TestSetups.TestSetupsUpdateInsert(_user, connections[0], 0, ref decoyRecord);
Assert.IsTrue(0 == hr, "Should be able to insert a decoy test setup");
//valid get all tests, should return the test we inserted
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 0, null, null, double.NaN, double.NaN, false, false, out var records, out var errors);
Assert.IsTrue(0 == hr, "Should return 0 for TestSetupsGet");
Assert.IsTrue(null != records && records.Length > 0, "TestSetupsGet should have retrieved records");
Assert.IsTrue(Array.Exists(records, r => r.Name == recordToInsert.Name), "TestSetupsGet should have retrieved our record");
//valid get all tests by id, should only return 1 of the 2 inserted
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 0, recordToInsert.Id, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(!records.Any(r => r.Id != recordToInsert.Id), "TestSetupsGet should only return ids requested");
Assert.IsTrue(0 == hr && null != records && records.Length > 0 && Array.Exists(records, r => r.Name == recordToInsert.Name),
"TestSetupsGet should have retrieved our record using the id");
//valid get all tests by name, should only return 1 of the 2 inserted
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 0, null, recordToInsert.Name, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 == hr && null != records && records.Length > 0 && Array.Exists(records, r => r.Name == recordToInsert.Name),
"TestSetupsGet should have retrieved our record using the name");
Assert.IsTrue(!records.Any(r => !r.Name.Equals(recordToInsert.Name)), "TestSetupsGet should only return names requested");
Assert.IsTrue(TestSetupsEqual(recordToInsert, records[0]), "TestSetupsGet should return untouched record");
//delete both - part of of cleanup
hr = DbAPI.DbAPI.TestSetups.TestSetupsDeleteById(_user, connections[0], new[] { recordToInsert.Id, decoyRecord.Id });
Assert.IsTrue(0 == hr, "TestSetupsDeleteById should return 0");
//testing get, it should not return either of the two records we inserted because they should no longer be around
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 0, null, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 == hr);
Assert.IsTrue(null == records || 0 == records.Length || !Array.Exists(records, r => r.Id == recordToInsert.Id || r.Id == decoyRecord.Id));
//test that it fails when no user provided
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(null, connections[0], 0, null, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 != hr, "Should not return 0 when user is invalid");
//test that it fails when no connection provided
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, null, 0, null, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 != hr, "Should not return 0 when connection is invalid");
}
/// <summary>
/// As of database Version 92, TestSetupGet_92() can now be used to test
/// Version 92 databases, as well as interoperability with Version 91 databases,
/// depending on which is database is present at "...\db\DataPRO.mdf.
/// </summary>
[Test]
public void TestSetupGet_92()
{
if (!_setup) { Setup(); }
TestLogin();
var connections = DbAPI.DbAPI.Connections.GetActiveConnections();
//we'll insert two records, one which is the one we'll be testing with get, and one that is just a decoy
//for tests which we do not expect to be returned, etc.
var recordToInsert = CreateFakeTestSetupWithROIs(2);
var decoyRecord = CreateFakeTestSetup();
var hr = DbAPI.DbAPI.TestSetups.TestSetupsUpdateInsert(_user, connections[0], 92, ref recordToInsert);
Assert.IsTrue(0 == hr, "Should be able to insert a test setup");
hr = DbAPI.DbAPI.TestSetups.TestSetupsUpdateInsert(_user, connections[0], 92, ref decoyRecord);
Assert.IsTrue(0 == hr, "Should be able to insert a decoy test setup");
//valid get all tests, should return the test we inserted
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 92, null, null, double.NaN, double.NaN, false, false, out var records, out var errors);
Assert.IsTrue(0 == hr, "Should return 0 for TestSetupsGet");
Assert.IsTrue(null != records && records.Length > 0, "TestSetupsGet should have retrieved records");
Assert.IsTrue(records.Any(r => r.Name == recordToInsert.Name), "TestSetupsGet should have retrieved our record");
//valid get all tests by id, should only return 1 of the 2 inserted
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 92, recordToInsert.Id, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(!records.Any(r => r.Id != recordToInsert.Id), "TestSetupsGet should only return ids requested");
Assert.IsTrue(0 == hr && null != records && records.Length > 0 && Array.Exists(records, r => r.Name == recordToInsert.Name),
"TestSetupsGet should have retrieved our record using the id");
//valid get all tests by name, should only return 1 of the 2 inserted
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 92, null, recordToInsert.Name, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 == hr && null != records && records.Length > 0 && Array.Exists(records, r => r.Name == recordToInsert.Name),
"TestSetupsGet should have retrieved our record using the name");
Assert.IsTrue(!records.Any(r => !r.Name.Equals(recordToInsert.Name)), "TestSetupsGet should only return names requested");
Assert.IsTrue(TestSetupsEqual(recordToInsert, records[0]), "TestSetupsGet should return untouched record");
//valid get the Test Setup, should only have something in the RegionsOfInterest if Version 91 database is used -
//(in DataPRO, when using a Version 92 database, a later Load will read from the new tables)
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 92, null, recordToInsert.Name, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 == hr && null != records && records.Length > 0 && Array.Exists(records, r => r.Name == recordToInsert.Name),
"TestSetupsGet should have retrieved our record using the name");
Assert.IsTrue(!Array.Exists(records, r => !r.Name.Equals(recordToInsert.Name)), "TestSetupsGet should only return names requested");
Assert.IsTrue(TestSetupsEqual(recordToInsert, records[0]), "TestSetupsGet should return untouched record");
DbAPI.DbAPI.GetDatabaseVersion(connections[0], out int serverDbVersion);
if (serverDbVersion == 91)
{
Assert.IsTrue(records[0].RegionsOfInterest.Count == 2, "TestSetupsGet should have returned a RegionsOfInterest structure");
}
else if (serverDbVersion >= 92)
{
Assert.IsTrue(records[0].RegionsOfInterest.Count == 0, "TestSetupsGet_92 should not have returned a RegionsOfInterest structure, but a later Load will read from the new tables");
}
//delete both - part of of cleanup
hr = DbAPI.DbAPI.TestSetups.TestSetupsDeleteById(_user, connections[0], new[] { recordToInsert.Id, decoyRecord.Id });
Assert.IsTrue(0 == hr, "TestSetupsDeleteById should return 0");
//testing get, it should not return either of the two records we inserted because they should no longer be around
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, connections[0], 92, null, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 == hr);
Assert.IsTrue(null == records || 0 == records.Length || !Array.Exists(records, r => r.Id == recordToInsert.Id || r.Id == decoyRecord.Id));
//test that it fails when no user provided
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(null, connections[0], 92, null, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 != hr, "Should not return 0 when user is invalid");
//test that it fails when no connection provided
hr = DbAPI.DbAPI.TestSetups.TestSetupsGet(_user, null, 92, null, null, double.NaN, double.NaN, false, false, out records, out errors);
Assert.IsTrue(0 != hr, "Should not return 0 when connection is invalid");
}
private bool TestSetupsEqual(ITestSetupRecord left, ITestSetupRecord right)
{
return left.Id == right.Id
&& left.AllowMissingSensors == right.AllowMissingSensors
&& left.AllowSensorIdToBlankChannel == right.AllowSensorIdToBlankChannel
&& left.AngularAccelLevelTriggerOn == right.AngularAccelLevelTriggerOn
&& left.AngularAccelLevelTriggerOnX == right.AngularAccelLevelTriggerOnX
&& left.AngularAccelLevelTriggerOnY == right.AngularAccelLevelTriggerOnY
&& left.AngularAccelLevelTriggerOnZ == right.AngularAccelLevelTriggerOnZ
&& left.AngularAccelLevelTriggerX == right.AngularAccelLevelTriggerX
&& left.AngularAccelLevelTriggerY == right.AngularAccelLevelTriggerY
&& left.AngularAccelLevelTriggerZ == right.AngularAccelLevelTriggerZ
&& left.AngularRate == right.AngularRate
&& left.AngularRateLevelTriggerOn == right.AngularRateLevelTriggerOn
&& left.AngularRateLevelTriggerOnX == right.AngularRateLevelTriggerOnX
&& left.AngularRateLevelTriggerOnY == right.AngularRateLevelTriggerOnY
&& left.AngularRateLevelTriggerOnZ == right.AngularRateLevelTriggerOnZ
&& left.AngularRateLevelTriggerX == right.AngularRateLevelTriggerX
&& left.AngularRateLevelTriggerY == right.AngularRateLevelTriggerY
&& left.AngularRateLevelTriggerZ == right.AngularRateLevelTriggerZ
&& left.AutomaticProgression == right.AutomaticProgression
&& left.AutomaticProgressionDelayMS == right.AutomaticProgressionDelayMS
&& left.AutoVerifyChannels == right.AutoVerifyChannels
&& left.AutoVerifyDelaySeconds == right.AutoVerifyDelaySeconds
&& left.CalibrationBehavior == right.CalibrationBehavior
&& left.CheckoutMode == right.CheckoutMode
&& left.ClockSyncProfileMaster == right.ClockSyncProfileMaster
&& left.ClockSyncProfileSlave == right.ClockSyncProfileSlave
&& left.CommonStatusLine == right.CommonStatusLine
&& left.CustomerDetails == right.CustomerDetails
&& left.DefaultNumberRealtimeGraphs == right.DefaultNumberRealtimeGraphs
&& left.Description == right.Description
&& left.Dirty == right.Dirty
&& left.DoAutoArm == right.DoAutoArm
&& left.DoROIDownload == right.DoROIDownload
&& left.DoStreaming == right.DoStreaming
&& left.DownloadAll == right.DownloadAll
&& left.ErrorMessage.Equals(right.ErrorMessage)
&& left.ExportFormats == right.ExportFormats
//&& left.ExtraProperties
&& left.HighgLevelTriggerOn == right.HighgLevelTriggerOn
&& left.HighgLevelTriggerOnX == right.HighgLevelTriggerOnX
&& left.HighgLevelTriggerOnY == right.HighgLevelTriggerOnY
&& left.HighgLevelTriggerOnZ == right.HighgLevelTriggerOnZ
&& left.HighgLinearAccRate == right.HighgLinearAccRate
&& left.HighgLinearLevelTriggerX == right.HighgLinearLevelTriggerX
&& left.HighgLinearLevelTriggerY == right.HighgLinearLevelTriggerY
&& left.HighgLinearLevelTriggerZ == right.HighgLinearLevelTriggerZ
&& left.HumidityLevelTriggerAbove == right.HumidityLevelTriggerAbove
&& left.HumidityLevelTriggerBelow == right.HumidityLevelTriggerBelow
&& left.HumidityLevelTriggerOn == right.HumidityLevelTriggerOn
&& left.InvertStartRecordCompletion == right.InvertStartRecordCompletion
&& left.InvertTriggerCompletion == right.InvertTriggerCompletion
&& left.IsComplete == right.IsComplete
// can be modified
//&& left.ISFFile.Equals(right.ISFFile)
&& left.LabDetails.Equals(right.LabDetails)
&& left.LastModified.Equals(right.LastModified)
&& left.LastModifiedBy.Equals(right.LastModifiedBy)
&& left.LocalOnly == right.LocalOnly
&& left.LowgLevelTriggerOn == right.LowgLevelTriggerOn
&& left.LowgLevelTriggerOnX == right.LowgLevelTriggerOnX
&& left.LowgLevelTriggerOnY == right.LowgLevelTriggerOnY
&& left.LowgLevelTriggerOnZ == right.LowgLevelTriggerOnZ
&& left.LowgLinearAccRate == right.LowgLinearAccRate
&& left.LowgLinearLevelTriggerX == right.LowgLinearLevelTriggerX
&& left.LowgLinearLevelTriggerY == right.LowgLinearLevelTriggerY
&& left.LowgLinearLevelTriggerZ == right.LowgLinearLevelTriggerZ
&& left.MeasureSquibResistancesStep == right.MeasureSquibResistancesStep
&& left.Name.Equals(right.Name)
&& left.NotAllChannelsRealTime == right.NotAllChannelsRealTime
&& left.NotAllChannelsViewer == right.NotAllChannelsViewer
&& left.NumberOfEvents == right.NumberOfEvents
&& left.WakeUpMotionTimeout == right.WakeUpMotionTimeout
&& left.PostTestDiagnosticsLevel == right.PostTestDiagnosticsLevel
&& left.PostTriggerSeconds == right.PostTriggerSeconds
&& left.PressureLevelTriggerAbove == right.PressureLevelTriggerAbove
&& left.PressureLevelTriggerBelow == right.PressureLevelTriggerBelow
&& left.PressureLevelTriggerOn == right.PressureLevelTriggerOn
&& left.PreTriggerSeconds == right.PreTriggerSeconds
&& left.QuitTestWithoutWarning == right.QuitTestWithoutWarning
&& left.QuitTestWithoutWarning == right.QuitTestWithoutWarning
&& left.RecordingMode == right.RecordingMode
//&& left.RegionsOfInterest
&& left.RequireUserConfirmationOnErrors == right.RequireUserConfirmationOnErrors
&& left.ROIEnd == right.ROIEnd
&& left.ROIStart == right.ROIStart
&& left.RTCScheduleDuration.Equals(right.RTCScheduleDuration)
//can be modified on insert if invalid
//&& left.RTCScheduleStartDateTime.Equals(right.RTCScheduleStartDateTime)
&& left.RTCScheduleTriggerOn == right.RTCScheduleTriggerOn
&& left.SameAsDownloadFolder == right.SameAsDownloadFolder
&& left.SamplesPerSecondAggregate.Equals(right.SamplesPerSecondAggregate)
&& left.Settings.Equals(right.Settings)
&& left.StrictDiagnostics == right.StrictDiagnostics
&& left.SuppressMissingSensorsWarning == right.SuppressMissingSensorsWarning
&& left.TemperatureHumidityPressureRate == right.TemperatureHumidityPressureRate
&& left.TemperatureLevelTriggerAbove == right.TemperatureLevelTriggerAbove
&& left.TemperatureLevelTriggerBelow == right.TemperatureLevelTriggerBelow
&& left.TemperatureLevelTriggerOn == right.TemperatureLevelTriggerOn
&& left.TestEngineerDetails == right.TestEngineerDetails
&& left.TestSetupUniqueId == right.TestSetupUniqueId
&& left.TimedIntervalDuration == right.TimedIntervalDuration
&& left.TimedIntervalEvents == right.TimedIntervalEvents
&& left.IntervalBetweenEventStartsMinutes == right.IntervalBetweenEventStartsMinutes
&& left.TimedIntervalTriggerOn == right.TimedIntervalTriggerOn
&& left.TimedIntervalUnits == right.TimedIntervalUnits
&& left.TriggerCheckRealtime == right.TriggerCheckRealtime
&& left.TriggerCheckStep == right.TriggerCheckStep
&& left.TurnOffExcitation == right.TurnOffExcitation
&& left.UploadData == right.UploadData;
}
}
}

View File

@@ -0,0 +1,121 @@
using System;
using System.Data.SqlClient;
using NUnit.Framework;
using System.Data;
namespace DatabaseUnitTesting
{
[TestFixture]
public class SensorsAnalogTests : TestSetups
{
[Test]
// ============================================================
// Send new valid analog sensor parameters to sp_SensorsAnalogUpdateInsert and
// compare all fields except LastModified and new ID. Pass if all fields in SensorsAnalog
// table are entered.
// ============================================================
[Category("sp_SensorsAnalogUpdateInsert")]
public void VerifyWriteToAnalogTable_sp_SensorsAnalogUpdateInsertTest()
{
string filename = TestResultPath + "AnalogSensorInsertTest.xml";
// only data in SensorsAnalog table will be compared
UnitTests.AddObjectComparison("dbo", "SensorsAnalog");
// But the LastModified column is excluded from comparison,
// just to demonstrate how we do it.
UnitTests.AddColumnToIgnore("dbo", "SensorsAnalog", "LastModified");
UnitTests.AddColumnToIgnore("dbo", "SensorsAnalog", "Id");
UnitTests.AddColumnToIgnore("dbo", "SensorsAnalog", "Created");
Command.CommandType = CommandType.StoredProcedure;
Command.CommandText = "sp_SensorsAnalogUpdateInsert";
Command.Parameters.Add(new SqlParameter("@SerialNumber", SqlDbType.NVarChar, 50) { Value = "CubicSensor_18" });
Command.Parameters.Add(new SqlParameter("@UserSerialNumber", SqlDbType.NVarChar, 50) { Value = "" });
Command.Parameters.Add(new SqlParameter("@Model", SqlDbType.NVarChar, 50) { Value = "" });
Command.Parameters.Add(new SqlParameter("@Manufacturer", SqlDbType.NVarChar, 50) { Value = "DTS" });
Command.Parameters.Add(new SqlParameter("@Status", SqlDbType.SmallInt) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@MeasurementUnit", SqlDbType.NVarChar, 50) { Value = "mm" });
Command.Parameters.Add(new SqlParameter("@OffsetToleranceLow", SqlDbType.Float) { Value = -100 });
Command.Parameters.Add(new SqlParameter("@OffsetToleranceHigh", SqlDbType.Float) { Value = 100 });
Command.Parameters.Add(new SqlParameter("@eId", SqlDbType.NVarChar, 50) { Value = "AABBCCDD" });
Command.Parameters.Add(new SqlParameter("@Capacity", SqlDbType.Float) { Value = 2000 });
Command.Parameters.Add(new SqlParameter("@Comment", SqlDbType.NVarChar, 255) { Value = "" });
Command.Parameters.Add(new SqlParameter("@BridgeType", SqlDbType.SmallInt) { Value = 3 });
Command.Parameters.Add(new SqlParameter("@BridgeLegMode", SqlDbType.SmallInt) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@Shunt", SqlDbType.SmallInt) { Value = 1 });
Command.Parameters.Add(new SqlParameter("@Invert", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@UserValue1", SqlDbType.NVarChar, 50) { Value = "" });
Command.Parameters.Add(new SqlParameter("@UserValue2", SqlDbType.NVarChar, 50) { Value = "" });
Command.Parameters.Add(new SqlParameter("@UserValue3", SqlDbType.NVarChar, 50) { Value = "" });
Command.Parameters.Add(new SqlParameter("@FilterClass", SqlDbType.NVarChar, 50) { Value = "None" });
Command.Parameters.Add(new SqlParameter("@BridgeResistance", SqlDbType.Float) { Value = 349 });
Command.Parameters.Add(new SqlParameter("@IsoCode", SqlDbType.NVarChar, 50) { Value = "???????????????P" });
Command.Parameters.Add(new SqlParameter("@CheckOffset", SqlDbType.Bit) { Value = 1 });
Command.Parameters.Add(new SqlParameter("@SupportedExcitation", SqlDbType.NVarChar, 50) { Value = "Volt5" });
Command.Parameters.Add(new SqlParameter("@InitialEU", SqlDbType.Float) { Value = .501 });
Command.Parameters.Add(new SqlParameter("@CalInterval", SqlDbType.Int) { Value = 365 });
Command.Parameters.Add(new SqlParameter("@CalibrationSignal", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@InternalShuntResistance", SqlDbType.Float) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@ExternalShuntResistance", SqlDbType.Float) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@UniPolar", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@RangeLow", SqlDbType.Float) { Value = 10 });
Command.Parameters.Add(new SqlParameter("@RangeAve", SqlDbType.Float) { Value = 100 });
Command.Parameters.Add(new SqlParameter("@RangeHigh", SqlDbType.Float) { Value = 1000 });
Command.Parameters.Add(new SqlParameter("@Created", SqlDbType.DateTime) { Value = DateTime.Now });
Command.Parameters.Add(new SqlParameter("@TimesUsed", SqlDbType.BigInt) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@SensorCategory", SqlDbType.Int) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@BypassFilter", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@CouplingMode", SqlDbType.SmallInt) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@Version", SqlDbType.Int) { Value = 1 });
Command.Parameters.Add(new SqlParameter("@LastModified", SqlDbType.DateTime) { Value = DateTime.Now });
Command.Parameters.Add(new SqlParameter("@ModifiedBy", SqlDbType.NVarChar, 50) { Value = "TestUser" });
Command.Parameters.Add(new SqlParameter("@LocalOnly", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@AxisNumber", SqlDbType.SmallInt) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@NumberOfAxes", SqlDbType.SmallInt) { Value = 1 });
Command.Parameters.Add(new SqlParameter("@UserTags", SqlDbType.VarBinary) { Value = new byte[10 * sizeof(int)] });
Command.Parameters.Add(new SqlParameter("@DoNotUse", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@Broken", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@DiagnosticsMode", SqlDbType.Bit) { Value = 0 });
Command.Parameters.Add(new SqlParameter("@FirstUseDate", SqlDbType.DateTime) { Value = DBNull.Value });
Command.Parameters.Add(new SqlParameter("@LatestCalibrationId", SqlDbType.Int) { Value = DBNull.Value });
var newIdParam = new SqlParameter("@new_id", SqlDbType.Int) { Direction = ParameterDirection.Output };
Command.Parameters.Add(newIdParam);
var errorNumberParam = new SqlParameter("@errorNumber", SqlDbType.Int) { Direction = ParameterDirection.Output };
Command.Parameters.Add(errorNumberParam);
var errorMessageParam = new SqlParameter("@errorMessage", SqlDbType.NVarChar, 250) { Direction = ParameterDirection.Output };
Command.Parameters.Add(errorMessageParam);
Command.ExecuteNonQuery();
if (BSETUPMODE)
UnitTests.WriteDiffsToXml(filename);
else
Assert.IsTrue(UnitTests.CompareDiffsToXml(filename));
}
//[Test]
// ============================================================
// Send valid analog sensor parameters to sp_SensorsAnalogUpdateInsert for a sensor
// already in the database and compare all fields except LastModified, new ID, and Created.
// Pass if all fields in SensorsAnalog table are entered.
// ============================================================
//[Test]
// ============================================================
// Send valid analog sensor parameters to sp_SensorsAnalogUpdateInsert for a sensor
// already in the database and verify no new row is created in dbo.Sensors.
//
// ============================================================
//[Test]
// ============================================================
// Send valid analog sensor parameters to sp_SensorsAnalogUpdateInsert for a new sensor
// to be entered into the db and verify a new row is created in dbo.Sensors.
//
// ============================================================
}
}