当前位置: 首页>>代码示例>>C#>>正文


C# Product.SayHello方法代码示例

本文整理汇总了C#中Acme.Biz.Product.SayHello方法的典型用法代码示例。如果您正苦于以下问题:C# Product.SayHello方法的具体用法?C# Product.SayHello怎么用?C# Product.SayHello使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Acme.Biz.Product的用法示例。


在下文中一共展示了Product.SayHello方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SayHello_ParameterizedConstructor_Test

        public void SayHello_ParameterizedConstructor_Test()
        {
            //Arrange
            var currentProduct = new Product("Honda", 2346, "Nice car from Japan");
            var expected = "Hello Honda (2346): Nice car from Japan" + " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:ethanchang1984,项目名称:CSharpBP-Basics,代码行数:12,代码来源:ProductTests.cs

示例2: SayHello_ParameterizedConstructor

        public void SayHello_ParameterizedConstructor()
        {
            //Arrange
            var currentProduct = new Product(1, "Saw",
                                "15-inch steel blade hand saw");
            var expected = "Hello Saw (1): 15-inch steel blade hand saw";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:dldzone,项目名称:charpBestPractices,代码行数:13,代码来源:ProductTests.cs

示例3: SayHello_ParamterizedConstructor

        public void SayHello_ParamterizedConstructor()
        {
            //Arrange
            var currentProduct = new Product(1, "Hammer", "A sturdy tool");

            var expected = "Hello Hammer (1): A sturdy tool" +
                           " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:jimxshaw,项目名称:samples-csharp,代码行数:14,代码来源:ProductTests.cs

示例4: SayHelloTest

        public void SayHelloTest()
        {
            //Arrange
            var currentProduct = new Product();
            currentProduct.ProductName = "Saw";
            currentProduct.ProductId = 1;
            currentProduct.Description = "15-inch steel blade hand saw";
            var expected = "Hello Saw (1): 15-inch steel blade hand saw";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:dldzone,项目名称:charpBestPractices,代码行数:15,代码来源:ProductTests.cs

示例5: SayHello_ParameterizedConstructorTest

        public void SayHello_ParameterizedConstructorTest()
        {
            //Arrage
            var currentProduct = new Product(1,"Saw", "Steel Blade hand saw");
            //currentProduct.ProductId = 1;
            //currentProduct.ProductName = "Saw";
            //currentProduct.Description = "Steel Blade hand saw";
            var expectedMessage = "Hello Saw (1) Steel Blade hand saw";

            //Act
            Console.WriteLine("Current Product" + currentProduct.ProductName);
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expectedMessage, actual);
        }
开发者ID:manojkulkarni30,项目名称:CSharpBP-Basics,代码行数:16,代码来源:ProductTests.cs

示例6: SayHelloParmTest

        public void SayHelloParmTest()

        {
            //arrange
            var currentProduct = new Product(1, "Saw", "15-inch steel blade hand saw");

            var expected = "Hello Saw (1) 15-inch steel blade hand saw" +
               " Available on: ";

            //act
            var actual = currentProduct.SayHello();

      
            //assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:dldzone,项目名称:charpBestPractices,代码行数:16,代码来源:ProductTests.cs

示例7: SayHelloTest

        public void SayHelloTest()
        {
            //Arrange
            var currentProduct = new Product();
            currentProduct.ProductName = "Honda";
            currentProduct.ProductId = 2346;
            currentProduct.Description = "Nice car from Japan";
            currentProduct.ProductVendor.CompanyName = "Honda Ltd.";
            var expected = "Hello Honda (2346): Nice car from Japan" + " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:ethanchang1984,项目名称:CSharpBP-Basics,代码行数:16,代码来源:ProductTests.cs

示例8: SayHelloTest

        public void SayHelloTest()
        {
            //Arrage
            var currentProduct = new Product();
            currentProduct.ProductId = 1;
            currentProduct.ProductName = "Saw";
            currentProduct.Description = "Steel Blade hand saw";
            currentProduct.ProductVendor.CompanyName = "ABC Ltd";
            var expectedMessage = "Hello Saw (1) Steel Blade hand saw";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expectedMessage, actual);

        }
开发者ID:manojkulkarni30,项目名称:CSharpBP-Basics,代码行数:17,代码来源:ProductTests.cs

示例9: SayHello_ObjectInitializer

        public void SayHello_ObjectInitializer()
        {
            //Arrange
            var currentProduct = new Product
            {
                ProductId = 1,
                ProductName = "Saw",
                Description = "15-inch steel blade hand saw"
            };

            var expected = "Hello Saw (1): 15-inch steel blade hand saw";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:dldzone,项目名称:charpBestPractices,代码行数:18,代码来源:ProductTests.cs

示例10: SayHello_ObjectInitializer

        public void SayHello_ObjectInitializer()
        {
            var currentProduct = new Product
            {
                ProductId = 1,
                ProductName = "Hammer",
                Description = "A sturdy tool"
            };

            var expected = "Hello Hammer (1): A sturdy tool" +
                           " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:jimxshaw,项目名称:samples-csharp,代码行数:18,代码来源:ProductTests.cs

示例11: SayHelloTest

        public void SayHelloTest()
        {
            //Arrange
            var currentProduct = new Product();
            currentProduct.ProductId = 1;
            currentProduct.ProductName = "Hammer";
            currentProduct.Description = "A sturdy tool";
            currentProduct.ProductVendor.CompanyName = "XYZ Corporation";

            var expected = "Hello Hammer (1): A sturdy tool" +
                           " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:jimxshaw,项目名称:samples-csharp,代码行数:18,代码来源:ProductTests.cs

示例12: SayHello_ObjectInitializer_Test

        public void SayHello_ObjectInitializer_Test()
        {
            //Arrange
            var currentProduct = new Product
            {
                ProductName = "Honda",
                ProductId = 2346,
                Description = "Nice car from Japan",
            };

            var expected = "Hello Honda (2346): Nice car from Japan" + " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:ethanchang1984,项目名称:CSharpBP-Basics,代码行数:18,代码来源:ProductTests.cs

示例13: SayHelloTest

        public void SayHelloTest()

        {
            //arrange
            var currentProduct = new Product
            {
                ProductName = "Saw",
                ProductId = 1,
                Description = "15-inch steel blade hand saw"
                
            };
            // currentProduct.ProductName = "Saw";
            // currentProduct.ProductId = 1;
            // currentProduct.Description = "15-inch steel blade hand saw";
            currentProduct.ProductVendor.CompanyName = "ABC Company";
            var expected = "Hello Saw (1) 15-inch steel blade hand saw" +
                " Available on: ";

            //act
            var actual = currentProduct.SayHello();
           // Console.WriteLine(actual);
            //assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:dldzone,项目名称:charpBestPractices,代码行数:24,代码来源:ProductTests.cs

示例14: SayHelloTest

        public void SayHelloTest()
        {
            //Arrange
            var currentProduct = new Product
            {
                ProductName = "Saw",
                ProductId = 1,
                Description = "15-inch steel blade hand saw",
                ProductVendor = {CompanyName = "ABC Corp"}
            };
            var expected = "Hello Saw (1): 15-inch steel blade hand saw" +
                " Available on: ";

            //Act
            var actual = currentProduct.SayHello();

            //Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:Robooto,项目名称:AcmeApp,代码行数:19,代码来源:ProductTests.cs


注:本文中的Acme.Biz.Product.SayHello方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。