示例#1
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            log4net.GlobalContext.Properties["LogFileName"] = @"C:\\Users\\ahermeneanu\\Desktop\\logfile.txt"; // log file path
            log4net.Config.XmlConfigurator.Configure();

            Log.Info("Entering application.");

            Edition edition = new Edition("Publisher", 200, 2010, EBookType.EPaperBack, 2, 10);

            EditionService service = new EditionService();

            if (service.AddNewEdition(edition))
            {
                Log.Info("Edition added succesfully!");
                Console.WriteLine("Edition addded succesfully");
            }
            else
            {
                Log.Error("Failed to insert Edition!");
                Console.WriteLine("Edition not valid!");
            }

            Log.Info("LEaving application.");
        }
示例#2
0
 public override void AddNewInvalidEntityShouldFail()
 {
     edition.Publisher = "Io";
     Assert.IsFalse(service.AddNewEdition(edition), "Expected validation to fail");
 }