예제 #1
0
        public void Constructor_WithCommandParamAndData_ShouldHaveData()
        {
            var parameters = new Dictionary<string, string> {{"Initial", "1"}};
            var cmd = new SymCommand("Command", parameters, "data");

            cmd.Data.Should().NotBeNullOrEmpty();
        }
예제 #2
0
        public void Constructor_WithCommandAndParam_ShouldHaveTheParameter()
        {
            var parameters = new Dictionary<string, string> {{"Initial", "1"}};
            var cmd = new SymCommand("Command", parameters);

            cmd.HasParameter("Initial").Should().BeTrue();
        }
예제 #3
0
        public void Set_ExistingParameter_ParameterShouldHaveNewValue()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1=Value");

            cmd.Set("Parameter1", "NewValue");
            cmd.Parameters["Parameter1"].Should().Be("NewValue");
        }
예제 #4
0
        public void Set_NewParameter_ParameterShouldExist()
        {
            var cmd = new SymCommand();

            cmd.Set("Parameter3", "RandomValue");
            cmd.Parameters.ContainsKey("Parameter3").Should().BeTrue();
        }
예제 #5
0
        public void Set_NewParameter_ParameterShouldHaveCorrectValue()
        {
            var cmd = new SymCommand();

            cmd.Set("Parameter3", "RandomValue");
            cmd.Parameters["Parameter3"].Should().Be("RandomValue");
        }
예제 #6
0
        public void Constructor_WithCommandAndParam_ShouldHaveTheCorrectParameterValue()
        {
            var parameters = new Dictionary<string, string> {{"Initial", "1"}};
            var cmd = new SymCommand("Command", parameters);

            cmd.Get("Initial").Should().Be("1");
        }
예제 #7
0
        public void GetFileData_IncorrectFormattedData_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.Data = "RandomData";

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #8
0
        public void GetFileData_NoDataBetweenDelimiters_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FD\u00FE";

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #9
0
        public void GetFileData_CorrectFormatData_ShouldReturnCorrectFileData()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FDFile Data\u00FE";

            cmd.GetFileData().Should().Be("File Data");
        }
예제 #10
0
        public void GetFileData_DataMissingSecondDelimiter_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FDFile Data";

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #11
0
        public void Constructor_WithCommandParamAndData_ShouldHaveData()
        {
            var parameters = new Dictionary <string, string> {
                { "Initial", "1" }
            };
            var cmd = new SymCommand("Command", parameters, "data");

            cmd.Data.Should().NotBeNullOrEmpty();
        }
예제 #12
0
        public void Constructor_WithCommandAndParam_ShouldHaveTheParameter()
        {
            var parameters = new Dictionary <string, string> {
                { "Initial", "1" }
            };
            var cmd = new SymCommand("Command", parameters);

            cmd.HasParameter("Initial").Should().BeTrue();
        }
예제 #13
0
        public void GetFileData_DataWithIncorrectDelimiterOrder_ShouldThrowException()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FEFile Data\u00FD";

            Assert.Throws <ArgumentOutOfRangeException>(
                () => { cmd.GetFileData(); });
        }
예제 #14
0
        public void Constructor_WithCommandAndParam_ShouldHaveTheCorrectParameterValue()
        {
            var parameters = new Dictionary <string, string> {
                { "Initial", "1" }
            };
            var cmd = new SymCommand("Command", parameters);

            cmd.Get("Initial").Should().Be("1");
        }
예제 #15
0
        public void Parse_WithParameter_ShouldHave2Parameters()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1=RandomValue");

            cmd.Parameters.Count.Should().Be(2);
        }
예제 #16
0
        public void Parse_WithParameterWithNoValue_ShouldHaveParameterValueBlank()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1");

            cmd.Get("Parameter1").Should().BeNullOrEmpty();
        }
예제 #17
0
        public void Parse_WithParameterWithNoValue_ShouldHaveParameter()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1");

            cmd.HasParameter("Parameter1").Should().BeTrue();
        }
예제 #18
0
 public void Set_NewParameter_ParameterShouldExist()
 {
     var cmd = new SymCommand();
     cmd.Set("Parameter3", "RandomValue");
     cmd.Parameters.ContainsKey("Parameter3").Should().BeTrue();
 }
예제 #19
0
        public void GetFileData_CorrectFormatData_ShouldReturnCorrectFileData()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FDFile Data\u00FE";

            cmd.GetFileData().Should().Be("File Data");
        }
예제 #20
0
        public void Parse_WithParameter_ShouldHaveEmptyData()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage");

            cmd.Data.Should().BeNullOrEmpty();
        }
예제 #21
0
        public void Parse_WithParameter_ShouldHaveTheSpecifiedParameter()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1=RandomValue");

            cmd.HasParameter("Parameter1").Should().BeTrue();
        }
예제 #22
0
        public void GetFileData_EmptyData_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #23
0
 public void Constructor_NoArguments_ShouldHaveParameterMsgId()
 {
     var cmd = new SymCommand();
     cmd.HasParameter("MsgId").Should().BeTrue();
 }
예제 #24
0
 public void Constructor_WithCommand_ShouldHaveCorrectCommand()
 {
     var cmd = new SymCommand("Command");
     cmd.Command.Should().Be("Command");
 }
예제 #25
0
        public void Constructor_WithCommand_ShouldHaveParameterMsgId()
        {
            var cmd = new SymCommand("Command");

            cmd.HasParameter("MsgId").Should().BeTrue();
        }
예제 #26
0
        public void Constructor_NoArguments_ShouldHaveParameterMsgId()
        {
            var cmd = new SymCommand();

            cmd.HasParameter("MsgId").Should().BeTrue();
        }
예제 #27
0
        public void GetFileData_IncorrectFormattedData_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.Data = "RandomData";

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #28
0
        public void Parse_WithParameter_ShouldHaveCorrectCommand()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1=RandomValue");

            cmd.Command.Should().Be("CommandMessage");
        }
예제 #29
0
        public void ToString_WithAddedParameterMissingValue_ShouldBeCorrect()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1");

            cmd.ToString().Should().Contain("Parameter1");
        }
예제 #30
0
        public void Parse_WithParameter_ShouldHaveTheCorrectParameterValue()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage~Parameter1=RandomValue");

            cmd.Get("Parameter1").Should().Be("RandomValue");
        }
예제 #31
0
 public void Constructor_WithCommand_ShouldHaveParameterMsgId()
 {
     var cmd = new SymCommand("Command");
     cmd.HasParameter("MsgId").Should().BeTrue();
 }
예제 #32
0
        public void GetFileData_NoDataBetweenDelimiters_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FD\u00FE";

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #33
0
        public void GetFileData_DataWithIncorrectDelimiterOrder_ShouldThrowException()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FEFile Data\u00FD";

            Assert.Throws<ArgumentOutOfRangeException>(
                () => { cmd.GetFileData(); });
        }
예제 #34
0
        public void GetFileData_EmptyData_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.GetFileData().Should().BeNullOrEmpty();
        }
예제 #35
0
        public void Parse_WithNoTildes_ShouldHaveCorrectCommand()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage");

            cmd.Command.Should().Be("CommandMessage");
        }
예제 #36
0
        public void ToString_WithNoAddedParameters_ShouldBeCorrect()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage");

            cmd.ToString().Should().Contain("CommandMessage");
        }
예제 #37
0
        public void Parse_WithNoTildes_ShouldHaveHaveBlankData()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage");

            cmd.Data.Should().BeNullOrEmpty();
        }
예제 #38
0
        public void Parse_WithNoTildes_ShouldHaveHaveOneParameter()
        {
            SymCommand cmd = SymCommand.Parse("CommandMessage");

            cmd.Parameters.Count.Should().Be(1);
        }
예제 #39
0
 public void Set_NewParameter_ParameterShouldHaveCorrectValue()
 {
     var cmd = new SymCommand();
     cmd.Set("Parameter3", "RandomValue");
     cmd.Parameters["Parameter3"].Should().Be("RandomValue");
 }
예제 #40
0
        public void Constructor_WithCommand_ShouldHaveCorrectCommand()
        {
            var cmd = new SymCommand("Command");

            cmd.Command.Should().Be("Command");
        }
예제 #41
0
        public void GetFileData_DataMissingSecondDelimiter_ShouldReturnEmptyString()
        {
            var cmd = new SymCommand();

            cmd.Data = "\u00FDFile Data";

            cmd.GetFileData().Should().BeNullOrEmpty();
        }