Exemplo n.º 1
0
 public static void Clear()
 {
     if (logger == null)
     {
         return;
     }
     Fake.ClearConfiguration(logger);
     Fake.ClearRecordedCalls(logger);
 }
Exemplo n.º 2
0
        public void ClearConfiguration_should_be_guarded()
        {
            // Arrange

            // Act

            // Assert
            Expression <Action> call = () => Fake.ClearConfiguration(A.Dummy <object>());

            call.Should().BeNullGuarded();
        }
Exemplo n.º 3
0
        public void ClearConfiguration_should_be_guarded()
        {
            // Arrange

            // Act

            // Assert
#pragma warning disable CS0618 // ClearConfiguration is obsolete
            Expression <Action> call = () => Fake.ClearConfiguration(A.Dummy <object>());
#pragma warning restore CS0618 // ClearConfiguration is obsolete
            call.Should().BeNullGuarded();
        }
Exemplo n.º 4
0
        public void SetUp()
        {
            _predicates.Clear();
            _predicates.Add(x => false);
            Fake.ClearConfiguration(_responseFactory);
            Fake.ClearRecordedCalls(_responseFactory);
            Fake.ClearConfiguration(_handler);
            Fake.ClearRecordedCalls(_handler);

            _sut = new WebConfiguration(
                _predicates,
                _responseFactory,
                _handler);
        }
Exemplo n.º 5
0
        public static void ClearConfiguration(IFoo fake, bool configuredBehaviorWasUsed)
        {
            "Given a Fake"
            .x(() => fake = A.Fake <IFoo>());

            "And I configure a method call on the Fake"
            .x(() => A.CallTo(() => fake.AMethod()).Invokes(() => configuredBehaviorWasUsed = true));

            "When I clear the configuration"
            .x(() => Fake.ClearConfiguration(fake));

            "And I execute the previously-configured method"
            .x(() => fake.AMethod());

            "Then previously-configured behavior is not executed"
            .x(() => configuredBehaviorWasUsed.Should().BeFalse());
        }
Exemplo n.º 6
0
        public override void Dispose()
        {
            ContainerBuilder builder = GetContainerBuidler();

            builder.ComponentRegistryBuilder.Registered -= OnComponentRegistered;

            if (Objects != null)
            {
                foreach (object obj in Objects.Where(obj => Fake.IsFake(obj)))
                {
                    Fake.ClearConfiguration(obj);
                    Fake.ClearRecordedCalls(obj);
                }

                Objects.Dispose();
            }

            Objects = null;

            base.Dispose();
        }
Exemplo n.º 7
0
 public override void MutateRules(IFoo fake) => Fake.ClearConfiguration(fake);
 public void TestCleanup()
 {
     Fake.ClearConfiguration(fakeGameRequestAggregate);
 }
Exemplo n.º 9
0
 protected void ClearFakes()
 {
     Fake.ClearConfiguration(FakeRepository);
     Fake.ClearConfiguration(FakeRepositoryAggregate);
 }
Exemplo n.º 10
0
 public void TestCleanup()
 {
     Fake.ClearConfiguration(fakePlatformRequestAggregate);
 }
Exemplo n.º 11
0
 public void TestCleanup()
 {
     Fake.ClearConfiguration(fakeHostingEnvironment);
     Fake.ClearConfiguration(fakeConfiguration);
     Fake.ClearConfiguration(fakeLoggingBuilder);
 }
 protected void ClearFakes()
 {
     Fake.ClearConfiguration(FakeDbContext);
 }
 public void TestCleanup()
 {
     Fake.ClearConfiguration(fakeRepository);
     Fake.ClearConfiguration(fakeRepositoryAggregate);
     Fake.ClearConfiguration(fakeLogger);
 }
 protected void ClearFakes()
 {
     Fake.ClearConfiguration(LeftSpecificationAsync);
     Fake.ClearConfiguration(RightSpecificationAsync);
 }
 public void TestCleanup()
 {
     Fake.ClearConfiguration(fakeBaseServiceRequest);
 }
Exemplo n.º 16
0
 protected void ClearFakes()
 {
     Fake.ClearConfiguration(FakeRepositoryAsync);
     Fake.ClearConfiguration(FakeRepositoryAsyncAggregate);
     Fake.ClearConfiguration(FakeLogger);
 }