Beispiel #1
0
        public void CanGetCreateCustomer()
        {
            CreateCustomer newCustomer = new CreateCustomer
            {
                email    = "*****@*****.**",
                name     = "President",
                locale   = "en_US",
                metadata = "something"
            };
            GetCustomer createdCustomer = mollieClient.CreateCustomer(newCustomer);

            Assert.AreEqual(newCustomer.name, createdCustomer.name);
            Assert.AreEqual(newCustomer.email, createdCustomer.email);
            Assert.AreEqual(newCustomer.metadata, createdCustomer.metadata);
            Assert.AreEqual(newCustomer.locale, createdCustomer.locale);
            Assert.AreEqual("test", createdCustomer.mode);
            Assert.AreEqual("customer", createdCustomer.resource);

            Assert.IsTrue(createdCustomer.id.Length > 1);

            GetCustomer getCustomer = mollieClient.GetCustomer(createdCustomer.id);

            Assert.AreEqual(getCustomer.name, createdCustomer.name);
            Assert.AreEqual(getCustomer.name, createdCustomer.name);
            Assert.AreEqual(getCustomer.email, createdCustomer.email);
            Assert.AreEqual(getCustomer.metadata, createdCustomer.metadata);
            Assert.AreEqual(getCustomer.locale, createdCustomer.locale);
            Assert.AreEqual("test", getCustomer.mode);
            Assert.AreEqual("customer", getCustomer.resource);

            Customers customers = mollieClient.ListCustomers();

            Assert.IsTrue(customers.data.Count > 0);
        }