Пример #1
0
        public void ReadAsStream_TypeOverload_ReadsEmbeddedResourceAsStream()
        {
            // Arrange
            var testSubject = new EmbeddedResourcesService();

            // Act
            Stream result = testSubject.ReadAsStream(typeof(EmbeddedResourcesServiceUnitTests), DUMMY_EMBEDDED_RESOURCE_NAME);

            // Assert
            using var streamReader = new StreamReader(result);
            Assert.Equal(DUMMY_EMBEDDED_RESOURCE_CONTENT, streamReader.ReadToEnd());
        }
        public void ReadAsStream_TypeOverload_ReadsEmbeddedResourceAsStream()
        {
            // Arrange
            var testSubject = new EmbeddedResourcesService();

            // Act
            Stream result = testSubject.ReadAsStream(typeof(EmbeddedResourcesServiceUnitTests), _dummyEmbeddedResourceName);

            // Assert
            using (var streamReader = new StreamReader(result))
            {
                Assert.Equal(_dummyEmbeddedResourceContent, streamReader.ReadToEnd());
            }
        }