Ejemplo n.º 1
0
        public void UnionOfEightSetValue()
        {
            var union = new Union <int, int, int, int, int, int, double, string>("b");

            AssertThat(union.Type).IsEqualTo(typeof(string));
            AssertThat(union.GetValue()).IsEqualTo("b");
            union.SetValue(1.0);
            AssertThat(union.Type).IsEqualTo(typeof(double));
            AssertThat(union.GetValue()).IsEqualTo(1.0);
        }
Ejemplo n.º 2
0
        public void UnionOfTwoSetValue()
        {
            Union <int, string> union = new Union <int, string>("a");

            AssertThat(union.Type).IsEqualTo(typeof(string));
            AssertThat(union.GetValue()).IsEqualTo("a");
            union.SetValue(123);
            AssertThat(union.Type).IsEqualTo(typeof(int));
            AssertThat(union.GetValue()).IsEqualTo(123);
        }
Ejemplo n.º 3
0
        public void UnionOfTwoGetValueSecond()
        {
            Union <int, string> union = new Union <int, string>("world");

            AssertThat(union.GetValue()).IsEqualTo("world");
        }
Ejemplo n.º 4
0
        public void UnionOfTwoGetValueFirst()
        {
            Union <int, string> union = new Union <int, string>(1337);

            AssertThat(union.GetValue()).IsEqualTo(1337);
        }