コード例 #1
0
        public void FahClientJsonMessageExtractor_CannotExtractMessageWithNoHeader()
        {
            // Arrange
            var extractor = new FahClientJsonMessageExtractor();
            var buffer    = new StringBuilder();
            // Act
            var result = extractor.Extract(buffer);

            // Assert
            Assert.IsNull(result);
        }
コード例 #2
0
        public void FahClientJsonMessageExtractor_CannotExtractMessageWithNoFooter()
        {
            // Arrange
            var extractor = new FahClientJsonMessageExtractor();
            var buffer    = new StringBuilder(Info.Substring(0, Info.Length / 2));
            // Act
            var result = extractor.Extract(buffer);

            // Assert
            Assert.IsNull(result);
        }
コード例 #3
0
        public void FahClientJsonMessageExtractor_ExtractsMessageTextAsJson()
        {
            // Arrange
            var extractor = new FahClientJsonMessageExtractor();
            var buffer    = new StringBuilder(SimulationInfo);
            // Act
            var result = extractor.Extract(buffer);

            // Assert
            Assert.AreEqual("simulation-info", result.Identifier.MessageType);
            Assert.AreEqual(SimulationInfoJson, result.MessageText.ToString());
        }