예제 #1
0
        public void VerifyPapersSetOnView()
        {
            SetupAppModelToReturnPaperList();

            TestMediator.Register();
            MockGetPapersByTag.Verify(invoker => invoker.Invoke(IsMockSelectedTag()), Times.Once(), TestIntent);
        }
 public void VerifySetFilteredPapers()
 {
     SetupAppModelToReturnPaperList();
     TestMediator.Register();
     FilterInvoker.Invoke();
     MockView.Verify(view => view.SetPapers(IsFilteredPaperList()), Times.Once(), TestIntent);
 }
        private (DomainFacade domainFacade, TestMediator testMediator) CreateDomainFacade()
        {
            var testMediator = new TestMediator();
            var serviceLocatorForAcceptanceTesting = new ServiceLocatorForAcceptanceTesting(testMediator);

            return(new DomainFacade(serviceLocatorForAcceptanceTesting), testMediator);
        }
예제 #4
0
    // Start is called before the first frame update
    void Start()
    {
        testMediater = GetComponent <TestMediator>();

        #region//Plan0
        Observable.EveryUpdate()
        .Where(x => Input.GetKeyDown(KeyCode.Q))
        .Subscribe(x =>
        {
            print("press key Q,perform plan0");
            testMediater.getIslandType0.Subscribe(y =>
            {
                var sdf = y.Invoke(n);
                print(sdf);
            });
        });
        #endregion

        #region//Plan1
        Observable.EveryUpdate()
        .Where(x => Input.GetKeyDown(KeyCode.W))
        .Subscribe(x =>
        {
            print("press key W,perform plan1");
            var _temp = testMediater.getIslandType1.Invoke(n);
            print(_temp);
        });
        #endregion
    }
        public override async Task Setup()
        {
            await base.Setup();

            _fakeTwitchClient = new FakeTwitchClient();
            TestConfiguration.FakeValues["Twitch"] = "fake twitch";
            _mediator = TestMediator.Build(twitchClient: _fakeTwitchClient, bucketProvider: BucketProvider, keyGenerator: TestKeyGen, configuration: TestConfiguration);
            _service  = new MattsChatBotHostedService(_mediator, _fakeTwitchClient, new TwitchCommandRequestFactory(_mediator));
        }
        protected static void Initialize(TestContext testContext)
        {
            testMediator = new TestMediator();
            var serviceLocator = ServiceLocatorConfigurator.ConfigureForEndToEndIntegrationTests(testMediator);

            var deploymentDirectory = testContext.DeploymentDirectory;

            //emailTemplatesFolder = deploymentDirectory + serviceLocator.CreateConfigurationProvider().EmailTemplateContainer;
            //Directory.CreateDirectory(emailTemplatesFolder);

            domainFacadeUnderTest = GetDomainFacadeUnderTest(serviceLocator, testContext);
        }
예제 #7
0
    public override void Execute(INotification notification)
    {
        TestProxy    _proxy    = (TestProxy)this.Facade.RetrieveProxy(TestProxy.NAME);
        TestMediator _mediator = (TestMediator)this.Facade.RetrieveMediator(TestMediator.NAME);

        switch (notification.Name)
        {
        case "":
        {
            break;
        }
        }
    }
예제 #8
0
        public void RegisterAndRetrieveMediator()
        {
            // Make sure registering and retrieving a mediator works

            IMediator mediator = new TestMediator();

            Facade.Instance.RegisterMediator(mediator);

            // Make sure facade has mediator
            Assert.IsTrue(Facade.Instance.HasMediator(typeof(TestMediator).Name));

            // Get a mediator and make sure it's not null
            Assert.IsNotNull(Facade.Instance.RetrieveMediator <TestMediator>());
        }
예제 #9
0
        public void HelpSholdReturnsFalseAndNotWriteResults()
        {
            var wrote = false;

            var mediator = new TestMediator();

            mediator.MapT9InputsReturns = false;
            mediator.MapT9InputsOut     = new List <string>()
            {
                "r1", "r2"
            };

            var helper = TestServiceFactory.Factory.CreateHelper(mediator);

            var result = helper.Help((data) => wrote = true, true);

            Assert.IsFalse(result);
            Assert.IsFalse(wrote);
        }
예제 #10
0
        public void HelpSholdReturnsTrueAndWriteResults()
        {
            var expected = "Case #1: r1Case #2: r2";

            var mediator = new TestMediator();

            mediator.MapT9InputsReturns = true;
            mediator.MapT9InputsOut     = new List <string>()
            {
                "r1", "r2"
            };

            var helper    = TestServiceFactory.Factory.CreateHelper(mediator);
            var outresult = string.Empty;

            var result = helper.Help((data) => outresult += data, true);

            Assert.IsTrue(result);
            Assert.AreEqual(expected, outresult);
        }
        public static ServiceLocatorBase ConfigureForEndToEndIntegrationTests(TestMediator testMediator)
        {
            // Using ServiceLocatorForUnitTesting because we'd like to stub out the RuntimeEnvironmentIsolationService
            // Since this is an End-To-End Integration test we should strive to use all other classes as Actual production classes
            var serviceLocator = new ServiceLocatorUnitTesting();

            serviceLocator.ConfigurationProviderFactory = () => new ConfigurationProviderLocal();

            serviceLocator.PaymentGatewayFactory   = () => new PaymentGatewaySpy(testMediator);
            serviceLocator.TokenGeneratorFactory   = () => new TokenGenerator();
            serviceLocator.TokenDataManagerFactory = () => new TokenDataManager(serviceLocator);
            serviceLocator.BillingGatewayFactory   = () => new BillingGatewayFake(testMediator);

            var demoDCProjectDbConnectionInformation = serviceLocator.CreateConfigurationProvider().GetDbConnectionInformation(CONNECTION_STRING_NAME);

            serviceLocator.DbConnectionFactory = () =>
            {
                var dbProviderFactory = DbProviderFactories.GetFactory(demoDCProjectDbConnectionInformation.ProviderInvariantName);
                var dbConn            = dbProviderFactory.CreateConnection();
                dbConn.ConnectionString = demoDCProjectDbConnectionInformation.ConnectionString;
                return(dbConn);
            };
            return(serviceLocator);
        }
예제 #12
0
 private void button7_Click(object sender, EventArgs e)
 {
     TestMediator.Testar();
 }
예제 #13
0
 public ServiceLocatorForAcceptanceTesting(TestMediator testMediator)
 {
     _testMediator = testMediator;
 }
예제 #14
0
 public void VerifyInvokerMapEmpty()
 {
     TestMediator.GetInvokerMapHandlerCount(MockPaperDetailsReceivedInvoker.Object).ShouldEqual(1, TestIntent);
     TestMediator.Unregister();
     TestMediator.GetInvokerMapHandlerCount(MockPaperDetailsReceivedInvoker.Object).ShouldEqual(0, TestIntent);
 }
예제 #15
0
 // Start is called before the first frame update
 private void Awake()
 {
     testMediator = GetComponent <TestMediator>();
 }
 public HttpMessageHandlerSpy(TestMediator testMeditor)
 {
     _testMediator = testMeditor;
 }
 public void VerifyCurrentPaperSet()
 {
     TestMediator.Register();
     OnPaperSelectedInvoker.Invoke();
     MockAppModel.VerifySet(model => model.CurrentPaper = TestPaper, Times.Once(), TestIntent);
 }
 public void VerifyPapersNotSetOnView()
 {
     TestMediator.Register();
     MockView.Verify(view => view.SetPapers(IsAnyPaperList()), Times.Never(), TestIntent);
 }
 public void VerifyPapersSetOnView()
 {
     SetupAppModelToReturnPaperList();
     TestMediator.Register();
     MockView.Verify(view => view.SetPapers(IsTestPaperList()), Times.Once(), TestIntent);
 }
 public void VerifyPlaceholdText()
 {
     TestMediator.Register();
     MockView.VerifySet(view => view.SearchPlaceHolderText = "Search Papers", Times.Once(), TestIntent);
 }
예제 #21
0
 public PaymentGatewaySpy(TestMediator testMediator)
 {
     this.testMediator = testMediator;
 }
예제 #22
0
 public BillingGatewayFake(TestMediator testMediator)
 {
     this.testMediator = testMediator;
     billingAccounts.Add(new BillingAccountDetail(10003, 5, 23.5m, "Active"));
     searchResults.Add(new AccountSummary(10003, 5));
 }
예제 #23
0
 public void TestInitialize()
 {
     TestMediator.Reset();
 }