Example #1
0
        // Sets the fax property of a user
        public Item set_user_fax()
        {
            Innovator inn = this.getInnovator();

            string fax     = this.getProperty("fax", "");
            string user_id = this.getProperty("user_id", "");

            Item user = inn.newItem("User", "edit");

            user.setID(user_id);
            user = user.apply();

            if (user.isError())
            {
                return(this.getInnovator().newError(user.getErrorDetail()));
            }

            user.setProperty("fax", fax);
            Item res = user.apply();

            if (res.isError())
            {
                return(inn.newError(res.getErrorDetail()));
            }

            return(user);
        }
        public static void SetupEachTest()
        {
            fakeDataAccessLayer = Substitute.For <TestedMethod.IDataAccessLayer>();
            innovator           = ItemHelper.CreateInnovator();

            fakeDataAccessLayer = Substitute.For <TestedMethod.IDataAccessLayer>();

            fakeDataAccessLayer.NewItem(Arg.Any <string>(), Arg.Any <string>())
            .Returns(@params => ItemHelper.CreateItem((string)@params[0], (string)@params[1]));

            fakeDataAccessLayer.NewError(Arg.Any <string>())
            .Returns(@params => innovator.newError((string)@params[0]));
        }
Example #3
0
        // Creates a new document with the same name as the newly created Part
        public Item create_document_on_save()
        {
            Innovator inn = this.getInnovator();

            string docName  = this.getProperty("item_number", "");
            Item   document = inn.newItem("Document", "add");

            document.setProperty("item_number", docName);
            document = document.apply();

            if (document.isError())
            {
                return(inn.newError(document.getErrorDetail()));
            }

            return(this);
        }
 public Item NewError(string error)
 {
     return(Innovator.newError(error));
 }