Ejemplo n.º 1
0
        ////public void Chain<TParent, TChild>(Func<TParent, TChild> expression) where TParent : class where TChild : class
        ////{
        ////    Dep<TParent>().Stub(expression).Return(Dep<TChild>());
        ////}

        protected override void SetUpInner()
        {
            base.SetUpInner();
            AutoFixture.Customize(new AutoMoqCustomization());
            AutoFixture.Behaviors.Add(new OmitOnRecursionBehavior());
            AutoFixture.Customize <TSut>(o => o.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));
        }
Ejemplo n.º 2
0
        public async Task TestEmitBatchAsync_WithEnabledTrue_ShouldInsertLogEvents(IEnumerable <LogEvent> logEvents)
        {
            //Arrange
            AutoFixture.Customize <BigQuerySinkOptions>(opt => opt.With(p => p.IsEnabled, true));
            var connection = AutoFixture.Freeze <Mock <IConnection> >();

            //Act
            var sut = AutoFixture.Create <SinkTest>();
            await sut.TestEmitBatchAsync(logEvents);

            //Assert
            connection.Verify(mock => mock.CreateLogTableAsync(), Times.Once);
            connection.Verify(mock => mock.InsertLogEventsAsync(It.IsAny <IEnumerable <BigQueryLogEvent> >()), Times.Once);
        }
Ejemplo n.º 3
0
 protected override void SetUpInner()
 {
     base.SetUpInner();
     AutoFixture.Customize(new StrictAutoMoqCustomization());
 }
Ejemplo n.º 4
0
 protected void TurnOnAutoMoq()
 {
     AutoFixture.Customize(new AutoMoqCustomization());
 }