public void ConnectToServer() { BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider(); provider.TypeFilterLevel = TypeFilterLevel.Full; IDictionary props = new Hashtable(); props["port"] = 0; TcpChannel chnl = new TcpChannel(props, null, provider); ChannelServices.RegisterChannel(chnl, false); Console.WriteLine("Client : Canal Enregistré"); obj = (IAuthentification)Activator.GetObject(typeof(IAuthentification), "tcp://localhost:1235/ObjAuthentification"); if (obj == null) { Console.WriteLine("Problem du Serveur"); } else { Console.WriteLine("Reference Aquise avec succés"); } Console.WriteLine("Serveur Démarré"); }
public profil(IAuthentification obj) { InitializeComponent(); nomLabel.Text = loginForm.user.nom; prenomLabel.Text = loginForm.user.prenom; if (loginForm.user.type.Equals("Etudiant")) { SpecialiteLabel.Text = obj.acceder_specialite_etudiant(loginForm.user.id_utilisateur); } else { SpecialiteLabel.Text = obj.acceder_desing_specialite(loginForm.user.specialite); } }
public void Mail_test_addition() { IAuthentification stubAuthentification = Substitute.For <IAuthentification>(); IMail _mookMail = Substitute.For <IMail>(); _mookMail.When(x => x.sendMail("okay")) .Do(x => _mookMail._body = x.Arg <int>()); CalculSimple cs = new CalculSimple(stubAuthentification); //act var Result = cs.AdditionSimple(0, 0); //assert Assert.AreEqual(0, Result); }
//TODO: add IAuthentification into constructor public LoginController(IAuthentification i) { authView = i; }
public JWTController(IAuthentification userService, UserContext context) { _userService = userService; _context = context; }
// inject dependency "_repository" public InscriptionsController(IInscriptioneRepo repository, IMapper mapper, IAuthentification authentification) { _repository = repository; _mapper = mapper; _authentification = authentification; }