Inheritance: IEsbManagementEndpoint
コード例 #1
0
// ReSharper disable InconsistentNaming
        public void RolbackTo_Name_GetName()

        {
            //------------Setup for test--------------------------
            var rolbackTo = new RollbackTo();
            
            //------------Execute Test---------------------------

            //------------Assert Results-------------------------
            Assert.AreEqual("RollbackTo",rolbackTo.HandlesType());
        }
コード例 #2
0
        public void RolbackTo_CreateServiceEntry_ExpectCorrectDL()
        {
            //------------Setup for test--------------------------
            var rolbackTo = new RollbackTo();

            //------------Execute Test---------------------------
            var res = rolbackTo.CreateServiceEntry();
            //------------Assert Results-------------------------
            Assert.AreEqual("<DataList><Roles ColumnIODirection=\"Input\"/><ResourceXml ColumnIODirection=\"Input\"/><WorkspaceID ColumnIODirection=\"Input\"/><Dev2System.ManagmentServicePayload ColumnIODirection=\"Both\"></Dev2System.ManagmentServicePayload></DataList>", res.DataListSpecification.ToString());
            Assert.AreEqual(enActionType.InvokeManagementDynamicService, res.Actions.First().ActionType);
            Assert.AreEqual(res.Actions.First().SourceMethod,rolbackTo.HandlesType());
        }
コード例 #3
0
        public void RolbackTo_Execute_InvalidParams_NoVersion()
        {
            //------------Setup for test--------------------------
            var rolbackTo = new RollbackTo();
            var serializer = new Dev2JsonSerializer();
            var ws = new Mock<IWorkspace>();
            //------------Execute Test---------------------------
            var ax = rolbackTo.Execute(new Dictionary<string, StringBuilder> { { "resourceId", new StringBuilder(Guid.NewGuid().ToString()) } }, ws.Object);

            //------------Assert Results-------------------------
            var des = serializer.Deserialize<ExecuteMessage>(ax);
            Assert.AreEqual(des.HasError, true);
        }
コード例 #4
0
 public void RolbackTo_Execute_Valid_ExpectServerCalled()
 {
     //------------Setup for test--------------------------
     var rolbackTo = new RollbackTo();
     var serializer = new Dev2JsonSerializer();
     var ws = new Mock<IWorkspace>();
     var server = new Mock<IServerVersionRepository>();
     var res = Guid.NewGuid();
     //------------Execute Test---------------------------
     rolbackTo.ServerVersionRepo = server.Object;
     var ax = rolbackTo.Execute(new Dictionary<string, StringBuilder> { { "resourceId", new StringBuilder(res.ToString()) }, { "versionNumber", new StringBuilder("1") } }, ws.Object);
     
     //------------Assert Results-------------------------
     serializer.Deserialize<ExecuteMessage>(ax);
     server.Verify(a=>a.RollbackTo(res,"1"));
 }