public void TestMergeSerialization()
        {
            //--Arrange
            var idA     = Guid.NewGuid();
            var idB     = Guid.NewGuid();
            var records = new[]
            {
                new SuperEmployee
                {
                    EmployeeId        = idA,
                    SomeAwesomeFieldA = "Name A",
                    SomeAwesomeFieldB = null
                },
                new SuperEmployee
                {
                    EmployeeId        = idB,
                    SomeAwesomeFieldA = null,
                    SomeAwesomeFieldB = "Name B"
                }
            };
            var tableMap = new SuperEmployeeMap();

            //--Act
            var serialized = new JsonMergeSerializer <SuperEmployee>(tableMap).SerializeForMerge(records);

            //--Assert
            Assert.AreEqual($"[{{\"_\":0,\"_0\":\"{idA}\",\"_1\":\"Name A\",\"_2\":null}},{{\"_\":1,\"_0\":\"{idB}\",\"_1\":null,\"_2\":\"Name B\"}}]", serialized);
        }
        public void TestBuildsDecimalColumnParserWithConfiguredPrecisionAndScale()
        {
            //--Arrange
            var tableMap        = new PurchaseMap();
            var mergeSerializer = new JsonMergeSerializer <Purchase>(tableMap);

            //--Act
            var parser = mergeSerializer.BuildColumnParser(tableMap[x => x.Cost]);

            //--Assert
            StringAssert.StartsWith("[Cost] decimal(10,2) '$._", parser);
        }
        public void TestBuildsStringColumnParserWithConfiguredLength()
        {
            //--Arrange
            var tableMap        = new PurchaseMap();
            var mergeSerializer = new JsonMergeSerializer <Purchase>(tableMap);

            //--Act
            var parser = mergeSerializer.BuildColumnParser(tableMap[x => x.Name]);

            //--Assert
            StringAssert.StartsWith("[Name] nvarchar(20) '$._", parser);
        }
        public void TestBuildsBinaryColumnParserWithConfiguredLength()
        {
            //--Arrange
            var tableMap        = new StoredFileMap();
            var mergeSerializer = new JsonMergeSerializer <StoredFile>(tableMap);

            //--Act
            var parser = mergeSerializer.BuildColumnParser(tableMap[x => x.FileBytes]);

            //--Assert
            StringAssert.StartsWith("[FileBytes] nvarchar(max) '$._", parser);
        }
        public void TestBuildsStringColumnParser()
        {
            //--Arrange
            var tableMap        = new SuperEmployeeMap();
            var mergeSerializer = new JsonMergeSerializer <SuperEmployee>(tableMap);

            //--Act
            var parser = mergeSerializer.BuildColumnParser(tableMap[x => x.SomeAwesomeFieldA]);

            //--Assert
            StringAssert.StartsWith("[SomeAwesomeFieldA] nvarchar(max) '$._", parser);
        }