本文整理汇总了C#中Story类的典型用法代码示例。如果您正苦于以下问题:C# Story类的具体用法?C# Story怎么用?C# Story使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Story类属于命名空间,在下文中一共展示了Story类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEnable
void OnEnable()
{
story = (Story)target;
if (story.Forest == null) {
story.Forest = new Forest();
}
}
示例2: StoryViewModel
public StoryViewModel(Story story)
{
Story = story;
StartVM = new LocationScenarioViewModel(Story.StartingScenario, Story.StartingLocation, "Start");
EndVM = new LocationScenarioViewModel(Story.EndingScenario, Story.EndingLocation, "End");
}
示例3: verify_receive_appropriate_error_message_when_user_provides_a_bad_user_name_or_password
public void verify_receive_appropriate_error_message_when_user_provides_a_bad_user_name_or_password()
{
AuthenticationStatus authStatus = null;
Story authenticateUserStory = new Story("Authenticate User");
authenticateUserStory.AsA("Unauthenticated user")
.IWant("supply my user name and password to the login form")
.SoThat("I can authenticate to the application");
authenticateUserStory
.WithScenario("User provides an invalid user name")
.Given("My user name and password are ", "Big Daddy", "Gobldegook", delegate(string userName, string password) { UserRepositoryFactory factory = _mock.DynamicMock<UserRepositoryFactory>();
using (_mock.Record())
{
Expect.Call(factory.Create(userName, password))
.Return(_mock.DynamicMock<IUserRepository>());
}
_user = factory.Create(userName, password); })
.When("I authenticate the user", delegate {_service = _mock.DynamicMock<IAuthenticationService>();
using (_mock.Record())
{
Expect.Call(_service.Authenticate(_user))
.Return(new AuthenticationStatus(new Exception("Bad Username or Password")));
}
authStatus = _service.Authenticate(_user);})
.Then("I should receive an Authentication status of", Status.Failed, delegate(Status expectedStatus) {Assert.AreEqual(expectedStatus, authStatus.Status);});
}
示例4: verify_receive_appropriate_success_message_when_user_provides_a_good_user_name_and_password
public void verify_receive_appropriate_success_message_when_user_provides_a_good_user_name_and_password()
{
Story authenticateUserStory = new Story("Authenticate User");
authenticateUserStory.AsA("USer with a valid user name and password")
.IWant("supply my user name and password to the login form")
.SoThat("I can authenticate to the application");
authenticateUserStory
.WithScenario("User provides a valid user name and password")
.Given("My user name and password are ", "mmann", "validpassword_1", delegate(string userName, string password) { UserRepositoryFactory factory = _mock.DynamicMock<UserRepositoryFactory>();
using (_mock.Record())
{
Expect.Call(factory.Create(userName, password))
.Return(_mock.DynamicMock<IUserRepository>());
}
_user = factory.Create(userName, password); })
.When("I authenticate the user", delegate {_service = _mock.DynamicMock<IAuthenticationService>();
using (_mock.Record())
{
Expect.Call(_service.Authenticate(_user))
.Return(new AuthenticationStatus());
}
_authStatus = _service.Authenticate(_user);})
.Then("I should receive an Authentication status of", Status.Success, delegate(Status expectedStatus) {Assert.AreEqual(expectedStatus, _authStatus.Status);});
}
示例5: StoryController
public StoryController()
{
defaultStory =
new Story()
{
Id = 1,
Name = "Holly Hope Aspinall",
StoryTitle = "An Unexpected Journey",
Events = new List<Event>()
{
new Event
{
Id=1,
Title="Sticks The Landing",
Description="Holly was born today at 20:04 weighing in at 8lb 13oz",
DateTime=new DateTime(2015,06,12,20,04,00),
ImgUrl="Content/Images/dribbbleburger_1x.png",
},
new Event
{
Id=2,
Title="Welcome To The World",
Description="Holly is welcomed into the world by her grandparents",
DateTime=new DateTime(2015,06,12,22,00,00),
ImgUrl="Content/Images/Optionis.jpg",
},
},
};
}
示例6: Battle
public Battle()
{
if (story == null)
{
this.story = App.Story;
this.hero = story.Hero;
currentStatus = null;
}
InitializeComponent();
buttons = new Dictionary<Type, Button>()
{
{typeof (Rock), RockButton},
{typeof (Paper), PaperButton},
{typeof (Scissors), ScissorsButton},
};
foreach (var button in buttons.Values)
{
button.Visibility = Visibility.Collapsed;
}
returnToNavi.Visibility = Visibility.Collapsed;
RunBattle();
}
示例7: BulkGetUsersWithWrongGUID
public void BulkGetUsersWithWrongGUID()
{
_story = new Story("Get Memebers By IMembershipApi");
_story.AsA("User")
.IWant("to be able to get members, and give wrong users' GUID")
.SoThat("I can get nothing");
IDictionary<Guid, UserObject> _Users = new Dictionary<Guid, UserObject>();
Guid _temp = new Guid();
_story.WithScenario("Get members by ImembershipApi with the only one correct Ids")
.Given("only one correct GUID of user and fake one", () =>
{
createdObjectIds.Add(_temp);
})
.When("I use the BulkGet, I can get users ", () => _Users = _membershipApi.BulkGet(createdObjectIds))
.Then("The return a bunch of Users only contain null User ",
() =>
{
_Users[_temp].ShouldBeNull();
});
//createdObjectIds.Remove(_temp);
this.CleanUp();
}
示例8: Verify
public void Verify()
{
_story = this.BDDfy();
_story.Metadata.ShouldNotBe(null);
_story.Metadata.Title.ShouldBe(StoryTitle);
_story.Metadata.TitlePrefix.ShouldBe(StoryTitlePrefix);
}
示例9: TranslatePivotalToSolr
public RequirementsDocument TranslatePivotalToSolr(Story pivotalstory)
{
//return null;
return new RequirementsDocument()
{
ID = IDGenerator.GetUniqueIDForDocument(pivotalstory.Id.ToString(), _project.SystemType.ToDescription()),
Title = HttpUtility.HtmlEncode(pivotalstory.Name),
Status = pivotalstory.Current_State,
Project = _project.ProjectName,
Department = _project.Department,
SystemSource = _project.SystemType.ToDescription(),
LastIndexed = DateTime.Now,
Description = HttpUtility.HtmlEncode(pivotalstory.Description),
//AcceptanceCriteria = "Accepted At " + pivotalstory.AcceptedAt,
StoryPoints = pivotalstory.Estimate.ToString(),
ReleaseIteration = "tbd",
ReferenceID = "tbd",
StoryType = pivotalstory.Story_Type,
Team = pivotalstory.Owned_By,
//LastUpdated = pivotalstory.UpdatedAt,
StoryURI = pivotalstory.Url,
StoryTags = pivotalstory.Labels,
IterationStart = GetIterationDurationForStory(pivotalstory.Id,pivotalstory.Project_Id),
IterationEnd = GetIterationDurationForStory(pivotalstory.Id,pivotalstory.Project_Id)
};
}
示例10: CopyAttributes
public bool CopyAttributes(Story pivotalstorySource, WorkItem destinationWorkItem)
{
destinationWorkItem.Fields[ConchangoTeamsystemScrumEstimatedeffort].Value = pivotalstorySource.Estimate;
destinationWorkItem.Fields[ConchangoTeamsystemScrumBusinesspriority].Value = pivotalstorySource.Priority;
destinationWorkItem.Fields[ConchangoTeamsystemScrumDeliveryorder].Value = pivotalstorySource.Priority;
return true;
}
示例11: Create
public Story Create(string storyName, string creatorId, IEnumerable<string> genreNames)
{
var existingGenres = this.genreRepository.All()
.Where(x => genreNames.Contains(x.Name))
.ToList();
foreach (var genre in genreNames)
{
if (!existingGenres.AsQueryable().Select(x => x.Name).Contains(genre))
{
var newGenre = new Genre
{
Name = genre
};
existingGenres.Add(newGenre);
this.genreRepository.Add(newGenre);
}
}
this.genreRepository.Save();
var story = new Story
{
AuthorId = creatorId,
Name = storyName,
Genres = existingGenres
};
this.storyRepository.Add(story);
this.storyRepository.Save();
return this.storyRepository.All()
.FirstOrDefault(x => x.Name == story.Name);
}
示例12: MemberLoginWithCorrectUserNameAndPwd
public void MemberLoginWithCorrectUserNameAndPwd()
{
_story = new Story("Login with UserName and Password");
_story.AsA("User")
.IWant("to be able to login ")
.SoThat("I can use features");
_story.WithScenario("login with a correct username and password")
.Given("Create a new with old password", () =>
{
_Uobject = _utils.CreateUserObject("Eunge Liu",true);
_oldpassword = "123Hello";
_newpassword = "Hello123456";
_membershipApi.Save(_Uobject, _oldpassword, "123Hello");
createdObjectIds.Add(_Uobject.UserId);
})
.When("I login", () =>
{
_ret = _membershipApi.Login(_Uobject.UserName, _oldpassword);
})
.Then("The User can get Successful Logon",
() =>
{
_ret.ShouldEqual(LoginResults.Successful);
});
this.CleanUp();
}
示例13: Verify
public void Verify()
{
_story = this.BDDfy();
Assert.That(_story.Metadata, Is.Not.Null);
Assert.That(_story.Metadata.Title, Is.EqualTo(StoryTitle));
Assert.That(_story.Metadata.TitlePrefix, Is.EqualTo(StoryTitlePrefix));
}
示例14: Process
public void Process(Story story)
{
foreach (var scenario in story.Scenarios)
{
var executor = new ScenarioExecutor(scenario);
executor.InitializeScenario();
if (scenario.Example != null)
{
var unusedValue = scenario.Example.Values.FirstOrDefault(v => !v.ValueHasBeenUsed);
if (unusedValue != null) throw new UnusedExampleException(unusedValue);
}
var stepFailed = false;
foreach (var executionStep in scenario.Steps)
{
if (stepFailed && ShouldExecuteStepWhenPreviousStepFailed(executionStep))
break;
if (executor.ExecuteStep(executionStep) == Result.Passed)
continue;
if (!executionStep.Asserts)
break;
stepFailed = true;
}
}
}
示例15: StoryContentPageViewModel
public StoryContentPageViewModel(Story story, int index, int height, int width)
{
_story = story;
_index = index;
_width = width;
_height = height;
}