Exemplo n.º 1
0
        public void GivenLoginRequestSucceeds()
        {
            var fakeLoginProvider = new FakeTestLoginProvider();

            fakeLoginProvider.SetupLoginSuccess();
            RegisterService <ILoginProvider>(fakeLoginProvider);
        }
Exemplo n.º 2
0
        public void ServerReturnsComplianceRecords_ComplianceScreenIsAccessed_ComplianceRecordsAreDisplayed()
        {
            var fakeLoginProvider = new FakeTestLoginProvider();

            fakeLoginProvider.SetupLoginSuccess();
            RegisterService <ILoginProvider>(fakeLoginProvider);
            const int numberOfRecords = 100;

            RegisterBuilder(ComplianceProviderBuilder.CreateBuilder().WithComplianceRecord(numberOfRecords));

            var rootObject     = CreateRootObject();
            var loginViewModel = (LoginViewModel)rootObject.ActiveItem;

            loginViewModel.SelectedLogin = "******";
            loginViewModel.LoginCommand.Execute(null);
            var mainViewModel       = (MainViewModel)rootObject.ActiveItem;
            var firstModule         = mainViewModel.Modules.OfType <ModuleViewModel>().First(t => t.Name == "Compliance");
            var moduleRootViewModel = (ComplianceRootViewModel)(firstModule.RootViewModel);

            var complianceRecords =
                moduleRootViewModel.ConsoleViewModel.ListViewModel.Items.OfType <ComplianceRecordViewModel>();

            Assert.AreEqual(numberOfRecords, complianceRecords.Count());
        }