Example #1
0
        public MainWindow()
        {
            InitializeComponent();
            try
            {
                //Dtb connection tests

                //Connection connection = new Connection();
                //connection.testDtb();
                //EntityConnection entity = new EntityConnection();
                //entity.AddBook();

                //Exception logger test
                //var toThrow = new Exception("test_message");
                //toThrow.Source = "test_source";
                //ExceptionLogger.Log(toThrow);
                //toThrow.Source = "test_source2";
                //ExceptionLogger.Log(toThrow,false);

                //PassHandler tests
                //PasswordHandler.HashAndSaltPass("test1");

                MainViewModel mainView    = new MainViewModel();
                var           passHandler = new PasswordHandler();
                var           result      = passHandler.HashAndSaltPass("abcd");
                var           result2     = passHandler.ConfirmPassword("Admin", "abcd", result);
                //var byteConverter = new ByteConverter();
                //var result = byteConverter.ToByteArray("023");
                //var result2 = byteConverter.ToString(result);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        public void HashAndSaltPass_DefaultBehaviour_ReturnsTheCorrectHashAndSalt(string pass)
        {
            //Arrange
            //Act
            var result = _passHandler.HashAndSaltPass(pass);

            //Assert
            Assert.That(result, Is.Not.EqualTo(new HashWithSalt()));
        }