예제 #1
0
        public void testEquals()
        {
            LoginData testObjectOne = new LoginData("test", SecureStringConverter.convertFromString("test"), "test.de");
            LoginData testObjectTwo = new LoginData("test", SecureStringConverter.convertFromString("test"), "test.de");

            Assert.True(testObjectOne.Equals(testObjectTwo));
        }
예제 #2
0
        public void testNotEqualOperator()
        {
            LoginData testObjectOne = new LoginData("test", SecureStringConverter.convertFromString("test"), "test.de");
            LoginData testObjectTwo = new LoginData("test", SecureStringConverter.convertFromString("test"), "test.de");

            Assert.False(testObjectOne != testObjectTwo);
        }
예제 #3
0
        public void testDomainGetter()
        {
            LoginData testobject = new LoginData("test",
                                                 SecureStringConverter.convertFromString("test"), "test.de");

            Assert.That(testobject.getDomain(), Is.EqualTo("test.de"));
        }
예제 #4
0
        public void testPasswordGetter()
        {
            LoginData testobject = new LoginData("test",
                                                 SecureStringConverter.convertFromString("test"), "test.de");

            Assert.That(Marshal.PtrToStringUni(Marshal.SecureStringToCoTaskMemUnicode(testobject.getPassword())),
                        Is.EqualTo("test"));
        }
        public void testConvertToSecureStringEmptyString()
        {
            SecureString securedString = SecureStringConverter.convertFromString("");

            Assert.AreEqual("", Marshal.PtrToStringUni(Marshal.SecureStringToCoTaskMemUnicode(securedString)));
        }