예제 #1
0
        public void Do_not_register_duplicate_emails()
        {
            var supplier1 = DataMother.CreateSupplier();

            supplier1.WaybillSource           = new WaybillSource(supplier1);
            supplier1.WaybillSource.EMailFrom = "*****@*****.**";
            session.Save(supplier1);
            session.Flush();

            controller.Params["source.Emails[0]"] = "*****@*****.**";
            Request.HttpMethod = "POST";
            controller.WaybillSourceSettings(supplier.Id);
            Assert.IsFalse(Response.WasRedirected);
            Assert.AreEqual("Ошибка сохранения", (controller.PropertyBag["message"] ?? "").ToString());
            Errors(supplier.WaybillSource);
            session.Clear();
        }