Exemplo n.º 1
0
        public void CanSerializeNestedDU()
        {
            var expected = DU2.NewC(DU1.NewA(1));

            Serialize(expected);
            Reset();
            var actual = Deserialize <object>();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void CanSerializeOptionalDU()
        {
            var expected = DU2.NewE(FSharpOption <DU1> .Some(DU1.NewA(1)));

            Serialize(expected);
            Reset();
            var actual = Deserialize <object>();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void CanSerializeOptionalDU()
        {
            var expected = DU2.NewE(FSharpOption <DU1> .Some(DU1.NewA(1)));

            Serialize(expected);
            Reset();
            var actual = Deserialize <object>();

            expected.ShouldDeepEqual(actual);
        }
Exemplo n.º 4
0
        public void CanSerializeNestedDU()
        {
            var expected = DU2.NewC(DU1.NewA(1));

            Serialize(expected);
            Reset();
            var actual = Deserialize <object>();

            expected.ShouldDeepEqual(actual);
        }
Exemplo n.º 5
0
        protected override void Init()
        {
            base.Init();

            list   = ListModule.OfArray(new[] { 123, 2342355, 456456467578, 234234, -234281 });
            set    = SetModule.OfArray(new[] { 123, 2342355, 456456467578, 234234, -234281 });
            record = new TestRecord(
                name: "John Doe",
                aref: FSharpOption <string> .Some("ok"),
                connections: "test");
            du  = DU2.NewC(DU1.NewB("test", 123));
            sdu = SDU1.NewB("hello", 123);
        }
 public void Serialize_DiscriminatedUnion()
 {
     SerializeAndCount(DU2.NewC(DU1.NewB("test", 123)));
 }
Exemplo n.º 7
0
 public override void Setup(BenchmarkContext context)
 {
     base.Setup(context);
     InitStreamWith(DU2.NewC(DU1.NewB("test", 123)));
 }