コード例 #1
0
            public void Should_Throw_On_Null_Settings_Parameter()
            {
                //Given
                ICakeContext context  = _Context;
                string       address  = RootAddress;
                HttpSettings settings = null;

                //When
                var record = Record.Exception(() => HttpClientAliases.HttpDelete(context, address, settings));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(settings));
            }
コード例 #2
0
            public void Should_Delete_Return_Void()
            {
                //Given
                ICakeContext context  = _Context;
                string       address  = $"{ RootAddress }/posts/1";
                HttpSettings settings = new HttpSettings()
                {
                    EnsureSuccessStatusCode = true
                };

                //When
                HttpClientAliases.HttpDelete(context, address, settings);

                //Then
                //???
            }
コード例 #3
0
            public void Should_Throw_On_Null_Or_Empty_Address_Parameter()
            {
                //Given
                ICakeContext context  = _Context;
                HttpSettings settings = new HttpSettings();
                string       address  = null;

                //When
                address = null;
                var nullRecord = Record.Exception(() => HttpClientAliases.HttpDelete(context, address, settings));

                address = "";
                var emptyRecord = Record.Exception(() => HttpClientAliases.HttpDelete(context, address, settings));

                address = "     ";
                var spaceRecord = Record.Exception(() => HttpClientAliases.HttpDelete(context, address, settings));

                //Then
                CakeAssert.IsArgumentNullException(nullRecord, nameof(address));
                CakeAssert.IsArgumentNullException(emptyRecord, nameof(address));
                CakeAssert.IsArgumentNullException(spaceRecord, nameof(address));
            }