public void Should_Throw_On_Null_Settings_Parameter()
            {
                //Given
                SsrsConnectionSettings settings = null;

                //When
                var nullRecord = Record.Exception(() => SsrsConnectionSettingsExtensions.UseDefaultCredientials(settings));

                //Then
                CakeAssert.IsArgumentNullException(nullRecord, nameof(settings));
            }
            public void Should_Throw_On_Invalid_ServiceEndpoint_Url_Parameter()
            {
                //Given
                SsrsConnectionSettings settings = new SsrsConnectionSettings();
                string serviceEndpoint          = "ftp://localhost/reportserver/ReportService2010.asmx";

                //When
                var record = Record.Exception(() => SsrsConnectionSettingsExtensions.SetServiceEndpoint(settings, serviceEndpoint));

                //Then
                CakeAssert.IsExceptionWithMessage <UriFormatException>(record, $"{ nameof(serviceEndpoint) } is not a valid http or https scheme url.");
            }
            public void Should_Set_ServiceEndpoint_Url()
            {
                //Given
                SsrsConnectionSettings settings = new SsrsConnectionSettings();
                string serviceEndpoint          = "http://localhost/reportserver/ReportService2010.asmx";

                //When
                SsrsConnectionSettingsExtensions.SetServiceEndpoint(settings, serviceEndpoint);

                //Then
                Assert.Equal(serviceEndpoint, settings.ServiceEndpoint);
            }
            public void Should_Throw_On_Null_ServiceEndpoint_Parameter()
            {
                //Given
                SsrsConnectionSettings settings = new SsrsConnectionSettings();
                string serviceEndpoint          = "";

                //When
                var record = Record.Exception(() => SsrsConnectionSettingsExtensions.SetServiceEndpoint(settings, serviceEndpoint));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(serviceEndpoint));
            }
            public void Should_Throw_On_Null_Password_Parameter()
            {
                //Given
                SsrsConnectionSettings settings = new SsrsConnectionSettings();

                string userName = "******";
                string password = string.Empty;
                string domain   = "MICROSOFT";

                //When
                var nullRecord = Record.Exception(() => SsrsConnectionSettingsExtensions.AuthenticateWith(settings, userName, password, domain));

                //Then
                CakeAssert.IsArgumentNullException(nullRecord, nameof(password));
            }