Exemplo n.º 1
0
 public void ToStandardMeasures_DecimalWithUnitConversion_ReturningConvertedStandardMeasures()
 {
     var measures = new[] { 1.0m, 2.0m, 3.0m, -2.0m }.Cast(ElectricCurrent.MilliAmpere);
     var expected = new ElectricCurrent(0.002m);
     var actual = measures.ElementAt(1);
     MeasureAssert.MeasuresAreEqual(expected, actual);
 }
Exemplo n.º 2
0
 public void ToStandardMeasures_DoubleNoUnitConversion_ReturningNonConvertedStandardMeasures()
 {
     var measures = new[] { 1.0, 2.0, 3.0, -2.0 }.Cast<Length>();
     var expected = new Length(3.0);
     var actual = measures.ElementAt(2);
     MeasureAssert.MeasuresAreEqual(expected, actual);
 }
Exemplo n.º 3
0
        private static void ThrowExceptionOnElementAt1()
        {
            var numbers = new[] { 3, 4 };

            numbers.ElementAt(3);
        }
Exemplo n.º 4
0
        private void SubscribeAppeal()
        {
            var appeals = new[] { 1, 2 }.ToArray();

            this.UpdateAsObservable()
                .Where(_ => canMove && isStableGround)
                .Where(_ => Input.GetButtonDown("Appeal"))
                .Select(_ => appeals.ElementAt(Random.Range(0, appeals.Length)))
                .Subscribe(no =>
                {
                    animator.SetFloat("appeal_no", no);
                    animator.SetTrigger("appeal");
                });
        }