public void Ensure_That_NotNull_Should_Not_Throw_ArgumentNullException_For_NotNull_Object()
        {
            var customerSample = new CustomerSample
            {
                Id             = 1,
                FullName       = "Bünyamin Aslan",
                AccountNumbers = new List <long> {
                    4073, 13, 4, 9, 36, 41, 44
                },
                Balance = 1000.01M
            };

            var customerSampleList = new List <CustomerSample>
            {
                new CustomerSample {
                    Id             = 1,
                    FullName       = "Bünyamin Aslan",
                    AccountNumbers = new List <long> {
                        4073, 13, 4, 9, 36, 41, 44
                    },
                    Balance = 1000.01M
                }
            };

            Ensure.That("customerSampleList", customerSampleList).Is.NotNull().Value.Should().Equal(customerSampleList);
        }
        public void Ensure_That_NotNull_Should_Throw_ArgumentNullException_For_Null_Object()
        {
            CustomerSample customerSample = null;

            Action act = () => Ensure.That("customerSample", customerSample).Is.NotNull();

            act.Should().Throw <ArgumentNullException>();
        }
Example #3
0
        public void AddCustomerPhoneNumberShouldThrowArgumentException(string phonenumber)
        {
            // Arrange (Arranging artifacts I might need during testing)

            CustomerSample customer = new CustomerSample();

            // Here, the act and assert are the same thing.
            Assert.Throws <ArgumentException>(() => customer.AddPhoneNumber(phonenumber));
        }