public void CreateWithNullContextThrows()
        {
            var expressionRequest = typeof(Expression <Func <object> >);
            var sut = new LambdaExpressionGenerator();

            Assert.Throws <ArgumentNullException>(() => sut.Create(expressionRequest, null));
        }
        public void CreateWithExpressionRequestReturnsCorrectResult(Type expected)
        {
            var expressionRequest = expected;
            var context           = new SpecimenContext(new Fixture());
            var sut = new LambdaExpressionGenerator();

            var result = sut.Create(expressionRequest, context);

            Assert.IsAssignableFrom(expected, result);
        }
        public void CreateWithLambdaExpressionTypeRequestReturnsCorrectResult()
        {
            var expressionRequest = typeof(Expression <Func <object> >);
            var dummyContainer    = new DelegatingSpecimenContext();
            var sut = new LambdaExpressionGenerator();

            var result = sut.Create(expressionRequest, dummyContainer);

            Assert.IsAssignableFrom <Expression <Func <object> > >(result);
        }
        public void CreateWithExpressionRequestReturnsCorrectResult(Type expected)
        {
            var expressionRequest = expected;
            var context = new SpecimenContext(new Fixture());
            var sut = new LambdaExpressionGenerator();

            var result = sut.Create(expressionRequest, context);

            Assert.IsType(expected, result);
        }
        public void CreateWithNonLambdaExpressionTypeRequestReturnsNoSpecimen()
        {
            var nonExpressionRequest = typeof(object);
            var dummyContainer       = new DelegatingSpecimenContext();
            var sut = new LambdaExpressionGenerator();

            var result = sut.Create(nonExpressionRequest, dummyContainer);

            Assert.IsType <NoSpecimen>(result);
        }
        public void CreateWithLambdaExpressionTypeRequestReturnsCorrectResult()
        {
            var expressionRequest = typeof(Expression<Func<object>>);
            var dummyContainer = new DelegatingSpecimenContext();
            var sut = new LambdaExpressionGenerator();

            var result = sut.Create(expressionRequest, dummyContainer);

            Assert.IsType<Expression<Func<object>>>(result);
        }
        public void CreateWithNonLambdaExpressionTypeRequestReturnsNoSpecimen()
        {
            var nonExpressionRequest = typeof(object);
            var dummyContainer = new DelegatingSpecimenContext();
            var sut = new LambdaExpressionGenerator();

            var result = sut.Create(nonExpressionRequest, dummyContainer);

            Assert.IsType<NoSpecimen>(result);
        }
        public void SutIsISpecimenBuilder()
        {
            var sut = new LambdaExpressionGenerator();

            Assert.IsAssignableFrom <ISpecimenBuilder>(sut);
        }
 public void CreateWithNullContextThrows()
 {
     var expressionRequest = typeof(Expression<Func<object>>);
     var sut = new LambdaExpressionGenerator();
     Assert.Throws<ArgumentNullException>(() => sut.Create(expressionRequest, null));
 }
 public void SutIsISpecimenBuilder()
 {
     var sut = new LambdaExpressionGenerator();
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
 }