public void For_TypeHasNullGuard(LazyGetTypeNameString sut)
        {
            // Arrange
            string @out;

            // Act
            // Assert
            Assert.Throws<ArgumentNullException>(() => sut.For(null, out @out));
        }
示例#2
0
        public void For_TypeHasNullGuard(LazyGetTypeNameString sut)
        {
            // Arrange
            string @out;

            // Act
            // Assert
            Assert.Throws <ArgumentNullException>(() => sut.For(null, out @out));
        }
示例#3
0
        public void For_ReturnsResultsFromInnerInstance(bool expectedResult,
                                                        [Frozen] IGetTypeNameString innerInstance,
                                                        LazyGetTypeNameString sut,
                                                        Type type,
                                                        string expectedTypeName)
        {
            // Arrange
            var @out = Arg.Any <string>();

            innerInstance.For(type, out @out).Returns(x =>
            {
                x[1] = expectedTypeName;
                return(expectedResult);
            });

            // Act
            string resultTypeName;
            var    result = sut.For(type, out resultTypeName);

            // Assert
            Assert.Equal(expectedResult, result);
            Assert.Equal(expectedTypeName, resultTypeName);
        }
        public void For_ReturnsResultsFromInnerInstance(bool expectedResult,
            [Frozen] IGetTypeNameString innerInstance,
            LazyGetTypeNameString sut,
            Type type,
            string expectedTypeName)
        {
            // Arrange
            var @out = Arg.Any<string>();

            innerInstance.For(type, out @out).Returns(x =>
                                                      {
                                                          x[1] = expectedTypeName;
                                                          return expectedResult;
                                                      });

            // Act
            string resultTypeName;
            var result = sut.For(type, out resultTypeName);

            // Assert
            Assert.Equal(expectedResult, result);
            Assert.Equal(expectedTypeName, resultTypeName);
        }