public void ErrUnexpected() { MockOpCtx.Setup(x => x.GetSharpflakeId <Vertex>()).Throws(new Exception("x")); var op = new CreateAppAccountOperation(); CreateAppAccountOperation.Result result = op.Execute(MockOpCtx.Object, MockBuild.Object, MockTasks.Object, "name", 1234, 3245); Assert.NotNull(result, "Result should be filled."); Assert.AreEqual(CreateAppAccountOperation.ResultStatus.UnexpectedError, result.Status, "Incorrect Status"); }
public void ErrDuplicateUser() { //Note: the fault would actually come from a "Create" task MockOpCtx.Setup(x => x.GetSharpflakeId <Vertex>()).Throws(new FabDuplicateFault("x")); var op = new CreateAppAccountOperation(); CreateAppAccountOperation.Result result = op.Execute(MockOpCtx.Object, MockBuild.Object, MockTasks.Object, "name", 1234, 3245); Assert.NotNull(result, "Result should be filled."); Assert.AreEqual(CreateAppAccountOperation.ResultStatus.DuplicateAppName, result.Status, "Incorrect Status"); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public override void SetUp() { base.SetUp(); vNewAppId = 685239856293; vNewMemId = 123235332; vAppCmd = "appCmd"; vMemCmd = "memCmd"; vSharpflakeQueue = new Queue <long>(new[] { vNewAppId, vNewMemId }); MockOpCtx.Setup(x => x.GetSharpflakeId <Vertex>()).Returns(vSharpflakeQueue.Dequeue); MockOpCtx.SetupGet(x => x.UtcNow).Returns(new DateTime(9999999999)); MockOpCtx.SetupGet(x => x.Code32).Returns("123456789012345678901234567890ab"); vCmdIdQueue = new Queue <string>(new[] { vAppCmd, vMemCmd }); MockAcc.Setup(x => x.GetLatestCommandId()).Returns(vCmdIdQueue.Dequeue); }