コード例 #1
0
        public void Convert_FromXDocumentToDocumentModel()
        {
            var expectedModel = MockAssets.SeedDocumentTestDocument();
            var xDoc          = MockAssets.SeedXDocumentDocument(expectedModel);

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

            actualModel.Should().BeEquivalentTo(expectedModel);
        }
コード例 #2
0
        public void Convert_FromDocumentModelToXDocument()
        {
            var model        = MockAssets.SeedDocumentTestDocument();
            var expectedXDoc = MockAssets.SeedXDocumentDocument(model);

            var actualXDocument = _sut.Convert(model);

            actualXDocument.Should().BeEquivalentTo(expectedXDoc);
        }
コード例 #3
0
        public void SerializeObject_ResultModelIsSerializedAccordingToFormat()
        {
            var model        = MockAssets.SeedDocumentTestDocument();
            var expectedText = MockAssets.SeedJsonDocument(model);

            var actualText = _sut.SerializeObject(model);

            actualText.Should().BeEquivalentTo(expectedText);
        }
コード例 #4
0
        public void Convert_FromJsonToDocumentModel()
        {
            var expectedModel = MockAssets.SeedDocumentTestDocument();
            var json          = MockAssets.SeedJsonDocument(expectedModel);

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

            actualModel.Should().BeEquivalentTo(expectedModel);
        }
コード例 #5
0
        public void DeserializeObject_ResultModelIsDeserializedAccordingToFormat()
        {
            var expectedModel = MockAssets.SeedDocumentTestDocument();

            var input = MockAssets.SeedXmlDocument(expectedModel);

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

            actualModel.Should().BeEquivalentTo(expectedModel);
        }
コード例 #6
0
        public void Convert_FromDocumentModelToJsont()
        {
            var model = MockAssets.SeedDocumentTestDocument();

            var expectedJson = MockAssets.SeedJsonDocument(model);

            var actualJson = _sut.Convert(model);

            actualJson.Should().BeEquivalentTo(expectedJson);
        }
コード例 #7
0
        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);
        }