예제 #1
0
 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>();
     //}
 }
예제 #2
0
        public void ReturnTrueAndPopulateResultGivenValueMatchExists()
        {
            var result = SampleStatus.TryParseValue(SampleStatus.Inactive.Value, out SampleStatus status);

            Assert.IsTrue(result);
            Assert.AreEqual(SampleStatus.Inactive, status);
        }
예제 #3
0
    public void ReturnTrueAndPopulateResultGivenDisplayNameMatchExists()
    {
        var result = SampleStatus.TryParse("Inactive", out var status);

        Assert.IsTrue(result);
        Assert.AreEqual(SampleStatus.Inactive, status);
    }
예제 #4
0
        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);
    }
예제 #7
0
파일: Task.cs 프로젝트: jtzhang163/TengDa
 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"]);
 }
예제 #8
0
 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);
 }
예제 #9
0
        public void ReturnExpandableEnumerationGivenMatchFound()
        {
            var result = SampleStatus.FromTValue(SampleStatus.Inactive.Value);

            Assert.AreEqual(SampleStatus.Inactive, result);
        }
예제 #10
0
    public void ReturnFalseGivenDisplayNameMatchDoesNotExist()
    {
        var result = SampleStatus.TryParse(System.Guid.NewGuid().ToString(), out var status);

        Assert.IsFalse(result);
    }
예제 #11
0
 private static extern int QISRAudioWrite(string sessionID, byte[] waveData, uint waveLen, SampleStatus audioStatus, ref EndpointStatus epStatus, ref RecognitionStatus recogStatus);
예제 #12
0
 public void ThrowArgumentExceptionGivenNoMatchingValueExists()
 {
     SampleStatus.ParseValue(-1234);
 }
예제 #13
0
 private void When(SampleCancelled e)
 {
     Status = SampleStatus.Cancelled;
 }
예제 #14
0
 private void When(SampleApproved e)
 {
     Status = SampleStatus.Approved;
 }
예제 #15
0
 private void When(SampleStarted e)
 {
     Id     = e.Id;
     Status = SampleStatus.Draft;
 }
예제 #16
0
        public void ReturnFalseGivenNoMatchingValueExists()
        {
            var result = SampleStatus.TryParseValue(-1234, out SampleStatus status);

            Assert.IsFalse(result);
        }
예제 #17
0
    public void ReturnEnumerationItemGivenMatchingValueExists()
    {
        var result = SampleStatus.ParseValue(SampleStatus.Inactive.Value);

        Assert.AreEqual(SampleStatus.Inactive, result);
    }
예제 #18
0
        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);
        }
예제 #20
0
 public void ThrowArgumentExceptionGivenNoMatchingDisplayNameExists()
 {
     SampleStatus.Parse(Guid.NewGuid().ToString());
 }