protected void InitFields(DataRow rowInfo) { this.Id = TengDa._Convert.StrToInt(rowInfo["Id"].ToString(), -1); this.getPutType = (GetPutType)Enum.Parse(typeof(GetPutType), rowInfo["GetPutType"].ToString()); this.clampStatus = (ClampStatus)Enum.Parse(typeof(ClampStatus), rowInfo["ClampStatus"].ToString()); this.clampOri = (ClampOri)Enum.Parse(typeof(ClampOri), rowInfo["ClampOri"].ToString()); this.clampId = TengDa._Convert.StrToInt(rowInfo["ClampId"].ToString(), -1); this.getPutTime = DateTime.Parse(rowInfo["GetPutTime"].ToString()); this.priority = TengDa._Convert.StrToInt(rowInfo["Priority"].ToString(), 1); this.name = rowInfo["Name"].ToString(); this.company = rowInfo["Company"].ToString(); this.model = rowInfo["Model"].ToString(); this.number = rowInfo["Number"].ToString(); this.location = rowInfo["Location"].ToString(); this.isEnable = Convert.ToBoolean(rowInfo["IsEnable"]); this.rgvValue = rowInfo["RgvValue"].ToString(); this.rgvGetFeederValue = rowInfo["RgvGetFeederValue"].ToString(); this.rgvPutFeederValue = rowInfo["RgvPutFeederValue"].ToString(); this.floorStatus = (FloorStatus)Enum.Parse(typeof(FloorStatus), rowInfo["FloorStatus"].ToString()); this.sampleStatus = (SampleStatus)Enum.Parse(typeof(SampleStatus), rowInfo["SampleStatus"].ToString()); this.PreFloorStatus = this.floorStatus; this.fromStationId = TengDa._Convert.StrToInt(rowInfo["FromStationId"].ToString(), -1); //for (int i = 0; i < Option.TemperaturePointCount + 1; i++) //{ // this.sampledDatas[i] = new List<float>(); //} }
public void ReturnTrueAndPopulateResultGivenValueMatchExists() { var result = SampleStatus.TryParseValue(SampleStatus.Inactive.Value, out SampleStatus status); Assert.IsTrue(result); Assert.AreEqual(SampleStatus.Inactive, status); }
public void ReturnTrueAndPopulateResultGivenDisplayNameMatchExists() { var result = SampleStatus.TryParse("Inactive", out var status); Assert.IsTrue(result); Assert.AreEqual(SampleStatus.Inactive, status); }
public void SerializeToNull() { SampleStatus status = null; var serialized = JsonConvert.SerializeObject(status); Assert.AreEqual("null", serialized); }
public static IList <SamplePersonEntity> Generate(int count) { return(new Faker <SamplePersonEntity>() .RuleFor(e => e.Name, (f, e) => f.Person.FullName) .RuleFor(e => e.Id, (f, e) => f.Random.Guid().ToString()) .RuleFor(e => e.Status, (f, e) => f.PickRandomParam(SampleStatus.GetAll())) .Generate(count)); }
public void ThrowArgumentExceptionGivenNoMatchingValueExists() { var value = -123; var result = SampleStatus.ParseValueOrCreate(value); var constructor = typeof(SampleStatus).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(string), typeof(string) }, null); Assert.IsNotNull(constructor); var expected = constructor.Invoke(new object?[] { value, value.ToString(CultureInfo.CurrentCulture), null }); Assert.AreEqual(expected, result); }
protected void InitFields(DataRow rowInfo) { this.Id = TengDa._Convert.StrToInt(rowInfo["Id"].ToString(), -1); this.clampOri = (ClampOri)Enum.Parse(typeof(ClampOri), rowInfo["ClampOri"].ToString()); this.fromType = (GetPutType)Enum.Parse(typeof(GetPutType), rowInfo["FromType"].ToString()); this.fromClampStatus = (ClampStatus)Enum.Parse(typeof(ClampStatus), rowInfo["FromClampStatus"].ToString()); this.toType = (GetPutType)Enum.Parse(typeof(GetPutType), rowInfo["ToType"].ToString()); this.toClampStatus = (ClampStatus)Enum.Parse(typeof(ClampStatus), rowInfo["ToClampStatus"].ToString()); this.sampleStatus = (SampleStatus)Enum.Parse(typeof(SampleStatus), rowInfo["SampleStatus"].ToString()); this.priority = TengDa._Convert.StrToInt(rowInfo["Priority"].ToString(), 1); this.cycleOrder = TengDa._Convert.StrToInt(rowInfo["CycleOrder"].ToString(), 1); this.description = rowInfo["Description"].ToString(); this.isEnable = Convert.ToBoolean(rowInfo["IsEnable"]); }
protected void InitFields(DataRow rowInfo) { this.Id = TengDa._Convert.StrToInt(rowInfo["Id"].ToString(), -1); this.getPutType = (GetPutType)Enum.Parse(typeof(GetPutType), rowInfo["GetPutType"].ToString()); this.clampStatus = (ClampStatus)Enum.Parse(typeof(ClampStatus), rowInfo["ClampStatus"].ToString()); this.clampOri = (ClampOri)Enum.Parse(typeof(ClampOri), rowInfo["ClampOri"].ToString()); this.clampId = TengDa._Convert.StrToInt(rowInfo["ClampId"].ToString(), -1); this.getPutTime = DateTime.Parse(rowInfo["GetPutTime"].ToString()); this.priority = TengDa._Convert.StrToInt(rowInfo["Priority"].ToString(), 1); this.name = rowInfo["Name"].ToString(); this.company = rowInfo["Company"].ToString(); this.model = rowInfo["Model"].ToString(); this.number = rowInfo["Number"].ToString(); this.location = rowInfo["Location"].ToString(); this.isEnable = Convert.ToBoolean(rowInfo["IsEnable"]); this.robotValues = rowInfo["RobotValues"].ToString(); this.floorStatus = (FloorStatus)Enum.Parse(typeof(FloorStatus), rowInfo["FloorStatus"].ToString()); this.sampleStatus = (SampleStatus)Enum.Parse(typeof(SampleStatus), rowInfo["SampleStatus"].ToString()); this.PreFloorStatus = this.floorStatus; this.fromStationId = TengDa._Convert.StrToInt(rowInfo["FromStationId"].ToString(), -1); }
public void ReturnExpandableEnumerationGivenMatchFound() { var result = SampleStatus.FromTValue(SampleStatus.Inactive.Value); Assert.AreEqual(SampleStatus.Inactive, result); }
public void ReturnFalseGivenDisplayNameMatchDoesNotExist() { var result = SampleStatus.TryParse(System.Guid.NewGuid().ToString(), out var status); Assert.IsFalse(result); }
private static extern int QISRAudioWrite(string sessionID, byte[] waveData, uint waveLen, SampleStatus audioStatus, ref EndpointStatus epStatus, ref RecognitionStatus recogStatus);
public void ThrowArgumentExceptionGivenNoMatchingValueExists() { SampleStatus.ParseValue(-1234); }
private void When(SampleCancelled e) { Status = SampleStatus.Cancelled; }
private void When(SampleApproved e) { Status = SampleStatus.Approved; }
private void When(SampleStarted e) { Id = e.Id; Status = SampleStatus.Draft; }
public void ReturnFalseGivenNoMatchingValueExists() { var result = SampleStatus.TryParseValue(-1234, out SampleStatus status); Assert.IsFalse(result); }
public void ReturnEnumerationItemGivenMatchingValueExists() { var result = SampleStatus.ParseValue(SampleStatus.Inactive.Value); Assert.AreEqual(SampleStatus.Inactive, result); }
public void ReturnEnumerationItemGivenMatchingDisplayNameExists() { var result = SampleStatus.Parse("Inactive"); Assert.AreEqual(SampleStatus.Inactive, result); }
public void ReturnTrueGivenLeftEqualsRight() { var altMax = SampleStatus.ParseValue(SampleStatus.Max.Value); Assert.IsTrue(SampleStatus.Max <= altMax); }
public void ThrowArgumentExceptionGivenNoMatchingDisplayNameExists() { SampleStatus.Parse(Guid.NewGuid().ToString()); }