Beispiel #1
0
 public void WhenSchemeIsWrong_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() => IapRdpUrl.FromString("http://www/"));
 }
Beispiel #2
0
 public void WhenHostNotEmpty_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() => IapRdpUrl.FromString("iap-rdp://host/my-project/us-central1-a/my-instance"));
 }
Beispiel #3
0
 public void WhenStringIsEmpty_ThenFromStringThrowsUriFormatException()
 {
     Assert.Throws <UriFormatException>(() => IapRdpUrl.FromString(string.Empty));
 }
Beispiel #4
0
 public void WhenStringIsNotAUri_ThenFromStringThrowsUriFormatException()
 {
     Assert.Throws <UriFormatException>(() => IapRdpUrl.FromString("::"));
 }
Beispiel #5
0
        public void WhenTripleSlashUsed_ThenToStringReturnsSameString()
        {
            var url = "iap-rdp:///my-project/us-central1-a/my-instance";

            Assert.AreEqual(url, IapRdpUrl.FromString(url).ToString(false));
        }
Beispiel #6
0
 public void WhenStringIsNull_ThenFromStringThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => IapRdpUrl.FromString(null));
 }
Beispiel #7
0
 public void WhenInstanceNameIsIsInvalid_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() =>
                                              IapRdpUrl.FromString("iap-rdp:///my-project/us-central1-a/__"));
 }
Beispiel #8
0
 public void WhenZoneIdIsIsInvalid_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() =>
                                              IapRdpUrl.FromString("iap-rdp:///my-project/__/my-instance"));
 }
Beispiel #9
0
 public void WhenProjectIdIsIsInvalid_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() =>
                                              IapRdpUrl.FromString("iap-rdp:///__/us-central1-a/my-instance"));
 }
Beispiel #10
0
 public void WhenTooManySlashed_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() => IapRdpUrl.FromString("iap-rdp:my-project/us-central1-a/my-instance/baz"));
 }
Beispiel #11
0
 public void WhenLeadingSlashMissing_ThenFromStringThrowsIapRdpUrlFormatException()
 {
     Assert.Throws <IapRdpUrlFormatException>(() => IapRdpUrl.FromString("iap-rdp:my-project/us-central1-a/my-instance"));
 }