コード例 #1
0
        public void Given_StringBuilder_when_NullifyStringBuilder_Then_ValueShouldBeChange()
        {
            char[] strAlphabet = { 'A', 'B', 'C' };
            string str         = new string(strAlphabet);
            string strpassing  = str;
            var    cSharpTypes = new cSharpTypes();

            cSharpTypes.ChangeValueOfString(strpassing);
            Assert.That(strpassing, Is.EqualTo(str));
        }
コード例 #2
0
        public void Given_StringBuilder_when_ChangeValueOfStringBuilder_Then_ValueShouldBeChange()
        {
            var stringBuilder = new StringBuilder();

            stringBuilder.Append(myStringValue);

            var cSharpTypes = new cSharpTypes();

            cSharpTypes.ChangeValueOfStringBuilder(stringBuilder);
            Assert.That(myStringValue, Is.Not.EqualTo(stringBuilder));
        }
コード例 #3
0
        public void Given_Outstruct_when_ChangeValueOut_Then_ValueShouldBeChange()
        {
            var cSharpTypes = new cSharpTypes();

            cSharpTypes.ChangeValueOut(out someStruct);

            Assert.That(someStruct.DecimalNumber, Is.Not.EqualTo(myDecimalNumber));
            Assert.That(someStruct.DoubleNumber, Is.Not.EqualTo(myDoubleNumber));
            Assert.That(someStruct.Number, Is.Not.EqualTo(myNumber));
            Assert.That(someStruct.StringValue, Is.Not.EqualTo(myStringValue));
        }
コード例 #4
0
        public void Given_Refstruct_when_ChangeValue_Then_ValueShouldNotBeChange()
        {
            var cSharpTypes = new cSharpTypes();

            InitialiseStruct();
            cSharpTypes.ChangeValue(ref someStruct);

            Assert.That(someStruct.DecimalNumber, Is.Not.EqualTo(myDecimalNumber));
            Assert.That(someStruct.DoubleNumber, Is.Not.EqualTo(myDoubleNumber));
            Assert.That(someStruct.Number, Is.Not.EqualTo(myNumber));
            Assert.That(someStruct.StringValue, Is.Not.EqualTo(myStringValue));
        }
コード例 #5
0
        public void Given_dto_when_ChangeValue_Then_ValueShouldBeChange()
        {
            var cSharpTypes = new cSharpTypes();

            InitialiseDto();
            cSharpTypes.ChangeValue(myDto);

            Assert.That(myDto.DecimalNumber, Is.Not.EqualTo(myDecimalNumber));
            Assert.That(myDto.DoubleNumber, Is.Not.EqualTo(myDoubleNumber));
            Assert.That(myDto.Number, Is.Not.EqualTo(myNumber));
            Assert.That(myDto.PropertyNumber, Is.Not.EqualTo(myPropertyNumber));
            Assert.That(myDto.PropertyString, Is.Not.EqualTo(myPropertystring));
            Assert.That(myDto.StringValue, Is.Not.EqualTo(myStringValue));
        }
コード例 #6
0
ファイル: cSharpTypes.cs プロジェクト: JohanWe/Code-Sample
        public void Given_struct_when_ChangeValue_Then_ValueShouldNotBeChange()
        {
            var cSharpTypes = new cSharpTypes();
            InitialiseStruct();
            cSharpTypes.ChangeValue(someStruct);

            Assert.That(someStruct.DecimalNumber, Is.EqualTo(myDecimalNumber));
            Assert.That(someStruct.DoubleNumber, Is.EqualTo(myDoubleNumber));
            Assert.That(someStruct.Number, Is.EqualTo(myNumber));
            Assert.That(someStruct.StringValue, Is.EqualTo(myStringValue));
        }
コード例 #7
0
ファイル: cSharpTypes.cs プロジェクト: JohanWe/Code-Sample
 public void Given_StringBuilder_when_NullifyStringBuilder_Then_ValueShouldBeChange()
 {
     char[] strAlphabet={'A','B','C'};
     string str = new string(strAlphabet);
     string strpassing = str;
     var cSharpTypes = new cSharpTypes();
     cSharpTypes.ChangeValueOfString(strpassing);
     Assert.That(strpassing, Is.EqualTo(str));
 }
コード例 #8
0
ファイル: cSharpTypes.cs プロジェクト: JohanWe/Code-Sample
        public void Given_StringBuilder_when_ChangeValueOfStringBuilder_Then_ValueShouldBeChange()
        {
            var stringBuilder=new StringBuilder();
            stringBuilder.Append(myStringValue);

            var cSharpTypes=new cSharpTypes();
            cSharpTypes.ChangeValueOfStringBuilder(stringBuilder);
            Assert.That(myStringValue, Is.Not.EqualTo(stringBuilder));
        }
コード例 #9
0
ファイル: cSharpTypes.cs プロジェクト: JohanWe/Code-Sample
        public void Given_Outstruct_when_ChangeValueOut_Then_ValueShouldBeChange()
        {
            var cSharpTypes = new cSharpTypes();
            cSharpTypes.ChangeValueOut(out someStruct);

            Assert.That(someStruct.DecimalNumber, Is.Not.EqualTo(myDecimalNumber));
            Assert.That(someStruct.DoubleNumber, Is.Not.EqualTo(myDoubleNumber));
            Assert.That(someStruct.Number, Is.Not.EqualTo(myNumber));
            Assert.That(someStruct.StringValue, Is.Not.EqualTo(myStringValue));
        }
コード例 #10
0
ファイル: cSharpTypes.cs プロジェクト: JohanWe/Code-Sample
        public void Given_dto_when_ChangeValue_Then_ValueShouldBeChange()
        {
            var cSharpTypes = new cSharpTypes();
            InitialiseDto();
            cSharpTypes.ChangeValue(myDto);

            Assert.That(myDto.DecimalNumber,Is.Not.EqualTo(myDecimalNumber));
            Assert.That(myDto.DoubleNumber,Is.Not.EqualTo(myDoubleNumber));
            Assert.That(myDto.Number,Is.Not.EqualTo(myNumber));
            Assert.That(myDto.PropertyNumber,Is.Not.EqualTo(myPropertyNumber));
            Assert.That(myDto.PropertyString,Is.Not.EqualTo(myPropertystring));
            Assert.That(myDto.StringValue,Is.Not.EqualTo(myStringValue));
        }