public void Convert_FromXDocumentToDocumentModel()
        {
            var expectedModel = MockAssets.SeedDocumentTestDocument();
            var xDoc          = MockAssets.SeedXDocumentDocument(expectedModel);

            var actualModel = _sut.Convert <Document>(xDoc);

            actualModel.Should().BeEquivalentTo(expectedModel);
        }
        public void Convert_FromDocumentModelToXDocument()
        {
            var model        = MockAssets.SeedDocumentTestDocument();
            var expectedXDoc = MockAssets.SeedXDocumentDocument(model);

            var actualXDocument = _sut.Convert(model);

            actualXDocument.Should().BeEquivalentTo(expectedXDoc);
        }
        public void SerializeObject_ResultModelIsSerializedAccordingToFormat()
        {
            var model        = MockAssets.SeedDocumentTestDocument();
            var expectedText = MockAssets.SeedJsonDocument(model);

            var actualText = _sut.SerializeObject(model);

            actualText.Should().BeEquivalentTo(expectedText);
        }
        public void Convert_FromJsonToDocumentModel()
        {
            var expectedModel = MockAssets.SeedDocumentTestDocument();
            var json          = MockAssets.SeedJsonDocument(expectedModel);

            var actualModel = _sut.Convert <Document>(json);

            actualModel.Should().BeEquivalentTo(expectedModel);
        }
        public void DeserializeObject_ResultModelIsDeserializedAccordingToFormat()
        {
            var expectedModel = MockAssets.SeedDocumentTestDocument();

            var input = MockAssets.SeedXmlDocument(expectedModel);

            var actualModel = _sut.DeserializeObject <Document>(input);

            actualModel.Should().BeEquivalentTo(expectedModel);
        }
        public void Convert_FromDocumentModelToJsont()
        {
            var model = MockAssets.SeedDocumentTestDocument();

            var expectedJson = MockAssets.SeedJsonDocument(model);

            var actualJson = _sut.Convert(model);

            actualJson.Should().BeEquivalentTo(expectedJson);
        }
        public void SerializeObject_ResultModelIsSerializedAccordingToFormat()
        {
            var model        = MockAssets.SeedDocumentTestDocument();
            var expectedText = MockAssets.SeedXmlDocument(model);

            var actualText = _sut.SerializeObject(model);

            var actualTextNormalized   = Regex.Replace(actualText, @"\s+", string.Empty);
            var expectedTextNormalized = Regex.Replace(expectedText, @"\s+", string.Empty);

            actualTextNormalized.Should().BeEquivalentTo(expectedTextNormalized);
        }