conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
using System;
using System.Linq;
using System.Threading.Tasks;
=======
>>>>>>>
using System;
using System.Linq;
using System.Threading.Tasks;
<<<<<<<
public partial class CourseService : ICourseService
{
private readonly IStorageBroker storageBroker;
private readonly ILoggingBroker loggingBroker;
private readonly IDateTimeBroker dateTimeBroker;
public CourseService(IStorageBroker storageBroker,
ILoggingBroker loggingBroker,
IDateTimeBroker dateTimeBroker)
{
this.storageBroker = storageBroker;
this.loggingBroker = loggingBroker;
this.dateTimeBroker = dateTimeBroker;
}
public ValueTask<Course> DeleteCourseAsync(Guid courseId) =>
TryCatch(async () =>
{
ValidateCourseId(courseId);
Course maybeCourse =
await this.storageBroker.SelectCourseByIdAsync(courseId);
ValidateStorageCourse(maybeCourse, courseId);
return await this.storageBroker.DeleteCourseAsync(maybeCourse);
});
public IQueryable<Course> RetrieveAllCourses() =>
TryCatch(() =>
{
IQueryable<Course> storageCourses = this.storageBroker.SelectAllCourses();
ValidateStorageCourses(storageCourses);
return storageCourses;
});
}
=======
public partial class CourseService : ICourseService
{
private readonly IStorageBroker storageBroker;
private readonly ILoggingBroker loggingBroker;
private readonly IDateTimeBroker dateTimeBroker;
public CourseService(IStorageBroker storageBroker,
ILoggingBroker loggingBroker,
IDateTimeBroker dateTimeBroker)
{
this.storageBroker = storageBroker;
this.loggingBroker = loggingBroker;
this.dateTimeBroker = dateTimeBroker;
}
public ValueTask<Course> ModifyCourseAsync(Course course) =>
TryCatch(async () =>
{
ValidateCourseOnModify(course);
Course maybeCourse = await this.storageBroker.SelectCourseByIdAsync(course.Id);
ValidateStorageCourse(maybeCourse, course.Id);
ValidateAgainstStorageCourseOnModify(inputCourse: course, storageCourse: maybeCourse);
return await this.storageBroker.UpdateCourseAsync(course);
});
public ValueTask<Course> DeleteCourseAsync(Guid courseId) =>
TryCatch(async () =>
{
ValidateCourseId(courseId);
Course maybeCourse =
await this.storageBroker.SelectCourseByIdAsync(courseId);
ValidateStorageCourse(maybeCourse, courseId);
return await this.storageBroker.DeleteCourseAsync(maybeCourse);
});
}
>>>>>>>
public partial class CourseService : ICourseService
{
private readonly IStorageBroker storageBroker;
private readonly ILoggingBroker loggingBroker;
private readonly IDateTimeBroker dateTimeBroker;
public CourseService(IStorageBroker storageBroker,
ILoggingBroker loggingBroker,
IDateTimeBroker dateTimeBroker)
{
this.storageBroker = storageBroker;
this.loggingBroker = loggingBroker;
this.dateTimeBroker = dateTimeBroker;
}
public ValueTask<Course> ModifyCourseAsync(Course course) =>
TryCatch(async () =>
{
ValidateCourseOnModify(course);
Course maybeCourse = await this.storageBroker.SelectCourseByIdAsync(course.Id);
ValidateStorageCourse(maybeCourse, course.Id);
ValidateAgainstStorageCourseOnModify(inputCourse: course, storageCourse: maybeCourse);
return await this.storageBroker.UpdateCourseAsync(course);
});
public ValueTask<Course> DeleteCourseAsync(Guid courseId) =>
TryCatch(async () =>
{
ValidateCourseId(courseId);
Course maybeCourse =
await this.storageBroker.SelectCourseByIdAsync(courseId);
ValidateStorageCourse(maybeCourse, courseId);
return await this.storageBroker.DeleteCourseAsync(maybeCourse);
});
public IQueryable<Course> RetrieveAllCourses() =>
TryCatch(() =>
{
IQueryable<Course> storageCourses = this.storageBroker.SelectAllCourses();
ValidateStorageCourses(storageCourses);
return storageCourses;
});
} |
<<<<<<<
public interface IStudentContactService
{
ValueTask<StudentContact> AddStudentContactAsync(StudentContact studentContact);
IQueryable<StudentContact> RetrieveAllStudentContacts();
}
=======
public interface IStudentContactService
{
IQueryable<StudentContact> RetrieveAllStudentContacts();
ValueTask<StudentContact> RetrieveStudentContactByIdAsync(Guid studentId, Guid contactId);
}
>>>>>>>
public interface IStudentContactService
{
ValueTask<StudentContact> AddStudentContactAsync(StudentContact studentContact);
IQueryable<StudentContact> RetrieveAllStudentContacts();
ValueTask<StudentContact> RetrieveStudentContactByIdAsync(Guid studentId, Guid contactId);
} |
<<<<<<<
public interface IStudentExamService
{
ValueTask<StudentExam> AddStudentExamAsync(StudentExam studentExam);
ValueTask<StudentExam> RetrieveStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
}
=======
public interface IStudentExamService
{
ValueTask<StudentExam> CreateStudentExamAsync(StudentExam studentExam);
IQueryable<StudentExam> RetrieveAllStudentExams();
ValueTask<StudentExam> RetrieveStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> ModifyStudentExamAsync(StudentExam studentExam);
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
}
>>>>>>>
public interface IStudentExamService
{
ValueTask<StudentExam> AddStudentExamAsync(StudentExam studentExam);
ValueTask<StudentExam> RetrieveStudentExamByIdAsync(Guid studentExamId);
IQueryable<StudentExam> RetrieveAllStudentExams();
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> ModifyStudentExamAsync(StudentExam studentExam);
} |
<<<<<<<
using System.Collections.Generic;
using System.Linq;
=======
using System.Linq;
>>>>>>>
using System.Linq;
using System.Collections.Generic;
using System.Linq;
<<<<<<<
[Fact]
public async Task ShouldRetrieveTeacherByIdAsync()
{
// given
DateTimeOffset dateTime = GetRandomDateTime();
Teacher randomTeacher = CreateRandomTeacher(dateTime);
Guid inputTeacherId = randomTeacher.Id;
Teacher storageTeacher = randomTeacher;
Teacher expectedTeacher = randomTeacher;
this.storageBrokerMock.Setup(broker =>
broker.SelectTeacherByIdAsync(inputTeacherId))
.ReturnsAsync(storageTeacher);
// when
Teacher actualTeacher =
await this.teacherService.RetrieveTeacherByIdAsync(inputTeacherId);
// then
actualTeacher.Should().BeEquivalentTo(expectedTeacher);
this.storageBrokerMock.Verify(broker =>
broker.SelectTeacherByIdAsync(inputTeacherId),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact]
public void ShouldRetrieveAllTeachers()
{
// given
DateTimeOffset dateTime = GetRandomDateTime();
IEnumerable<Teacher> randomTeachers = CreateRandomTeachers(dateTime);
IQueryable<Teacher> storageTeachers = randomTeachers.AsQueryable();
IQueryable<Teacher> expectedTeachers = randomTeachers.AsQueryable();
this.storageBrokerMock.Setup(broker =>
broker.SelectAllTeachers())
.Returns(storageTeachers);
// when
IQueryable<Teacher> actualTeachers = this.teacherService.RetrieveAllTeachers();
// then
actualTeachers.Should().BeEquivalentTo(expectedTeachers);
this.storageBrokerMock.Verify(broker =>
broker.SelectAllTeachers(),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact]
public async Task ShouldCreateTeacherAsync()
{
// given
DateTimeOffset dateTime = GetRandomDateTime();
Teacher randomTeacher = CreateRandomTeacher(dateTime);
Teacher inputTeacher = randomTeacher;
Teacher storageTeacher = randomTeacher;
Teacher expectedTeacher = randomTeacher;
this.storageBrokerMock.Setup(broker =>
broker.InsertTeacherAsync(inputTeacher))
.ReturnsAsync(storageTeacher);
// when
Teacher actualTeacher =
await this.teacherService.CreateTeacherAsync(inputTeacher);
// then
actualTeacher.Should().BeEquivalentTo(expectedTeacher);
this.storageBrokerMock.Verify(broker =>
broker.InsertTeacherAsync(inputTeacher),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
=======
[Fact]
public void ShouldRetrieveAllTeachers()
{
// given
IQueryable<Teacher> randomTeachers = CreateRandomTeachers();
IQueryable<Teacher> storageTeachers = randomTeachers;
IQueryable<Teacher> expectedTeachers = storageTeachers;
this.storageBrokerMock.Setup(broker =>
broker.SelectAllTeachers())
.Returns(storageTeachers);
// when
IQueryable<Teacher> actualTeachers =
this.teacherService.RetrieveAllTeachers();
// then
actualTeachers.Should().BeEquivalentTo(expectedTeachers);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Never);
this.storageBrokerMock.Verify(broker =>
broker.SelectAllTeachers(),
Times.Once);
this.dateTimeBrokerMock.VerifyNoOtherCalls();
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
}
>>>>>>>
[Fact]
public async Task ShouldRetrieveTeacherByIdAsync()
{
// given
DateTimeOffset dateTime = GetRandomDateTime();
Teacher randomTeacher = CreateRandomTeacher(dateTime);
Guid inputTeacherId = randomTeacher.Id;
Teacher storageTeacher = randomTeacher;
Teacher expectedTeacher = randomTeacher;
this.storageBrokerMock.Setup(broker =>
broker.SelectTeacherByIdAsync(inputTeacherId))
.ReturnsAsync(storageTeacher);
// when
Teacher actualTeacher =
await this.teacherService.RetrieveTeacherByIdAsync(inputTeacherId);
// then
actualTeacher.Should().BeEquivalentTo(expectedTeacher);
this.storageBrokerMock.Verify(broker =>
broker.SelectTeacherByIdAsync(inputTeacherId),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact]
public void ShouldRetrieveAllTeachers()
{
// given
IQueryable<Teacher> randomTeachers = CreateRandomTeachers();
IQueryable<Teacher> storageTeachers = randomTeachers;
IQueryable<Teacher> expectedTeachers = storageTeachers;
this.storageBrokerMock.Setup(broker =>
broker.SelectAllTeachers())
.Returns(storageTeachers);
// when
IQueryable<Teacher> actualTeachers =
this.teacherService.RetrieveAllTeachers();
// then
actualTeachers.Should().BeEquivalentTo(expectedTeachers);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Never);
this.storageBrokerMock.Verify(broker =>
broker.SelectAllTeachers(),
Times.Once);
this.dateTimeBrokerMock.VerifyNoOtherCalls();
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
}
[Fact]
public async Task ShouldCreateTeacherAsync()
{
// given
DateTimeOffset dateTime = DateTimeOffset.UtcNow;
Teacher randomTeacher = CreateRandomTeacher(dateTime);
randomTeacher.UpdatedBy = randomTeacher.CreatedBy;
randomTeacher.UpdatedDate = randomTeacher.CreatedDate;
Teacher inputTeacher = randomTeacher;
Teacher storageTeacher = randomTeacher;
Teacher expectedTeacher = randomTeacher;
this.dateTimeBrokerMock.Setup(broker =>
broker.GetCurrentDateTime())
.Returns(dateTime);
this.storageBrokerMock.Setup(broker =>
broker.InsertTeacherAsync(inputTeacher))
.ReturnsAsync(storageTeacher);
// when
Teacher actualTeacher =
await this.teacherService.CreateTeacherAsync(inputTeacher);
// then
actualTeacher.Should().BeEquivalentTo(expectedTeacher);
this.storageBrokerMock.Verify(broker =>
broker.InsertTeacherAsync(inputTeacher),
Times.Once);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
} |
<<<<<<<
public interface IStudentExamService
{
ValueTask<StudentExam> AddStudentExamAsync(StudentExam studentExam);
ValueTask<StudentExam> RetrieveStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
}
=======
public interface IStudentExamService
{
ValueTask<StudentExam> CreateStudentExamAsync(StudentExam studentExam);
IQueryable<StudentExam> RetrieveAllStudentExams();
ValueTask<StudentExam> RetrieveStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> ModifyStudentExamAsync(StudentExam studentExam);
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
}
>>>>>>>
public interface IStudentExamService
{
ValueTask<StudentExam> AddStudentExamAsync(StudentExam studentExam);
IQueryable<StudentExam> RetrieveAllStudentExams();
ValueTask<StudentExam> RetrieveStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
ValueTask<StudentExam> ModifyStudentExamAsync(StudentExam studentExam);
ValueTask<StudentExam> DeleteStudentExamByIdAsync(Guid studentExamId);
} |
<<<<<<<
using System;
=======
using System.Linq;
>>>>>>>
using System;
using System.Linq;
<<<<<<<
ValueTask<ExamAttachment> RetrieveExamAttachmentByIdAsync
(Guid examId, Guid attachmentId);
=======
IQueryable<ExamAttachment> RetrieveAllExamAttachments();
>>>>>>>
IQueryable<ExamAttachment> RetrieveAllExamAttachments();
ValueTask<ExamAttachment> RetrieveExamAttachmentByIdAsync
(Guid examId, Guid attachmentId); |
<<<<<<<
using System.Collections.Generic;
=======
using System.Linq;
>>>>>>>
using System.Linq;
using System.Collections.Generic;
<<<<<<<
private static int GetNegativeRandomNumber() => -1 * GetRandomNumber();
private static string GetRandomMessage() => new MnemonicString().GetValue();
public static IEnumerable<object[]> InvalidMinuteCases()
{
int randomMoreThanMinuteFromNow = GetRandomNumber();
int randomMoreThanMinuteBeforeNow = GetNegativeRandomNumber();
return new List<object[]>
{
new object[] { randomMoreThanMinuteFromNow },
new object[] { randomMoreThanMinuteBeforeNow }
};
}
private Filler<Teacher> CreateRandomTeacherFiller(DateTimeOffset dateTime)
=======
private static Filler<Teacher> CreateRandomTeacherFiller(DateTimeOffset dates)
>>>>>>>
private static int GetNegativeRandomNumber() => -1 * GetRandomNumber();
private static string GetRandomMessage() => new MnemonicString().GetValue();
public static IEnumerable<object[]> InvalidMinuteCases()
{
int randomMoreThanMinuteFromNow = GetRandomNumber();
int randomMoreThanMinuteBeforeNow = GetNegativeRandomNumber();
return new List<object[]>
{
new object[] { randomMoreThanMinuteFromNow },
new object[] { randomMoreThanMinuteBeforeNow }
};
}
private static Filler<Teacher> CreateRandomTeacherFiller(DateTimeOffset dates) |
<<<<<<<
ValueTask<Guardian> ModifyGuardianAsync(Guardian guardian);
=======
IQueryable<Guardian> RetrieveAllGuardians();
>>>>>>>
IQueryable<Guardian> RetrieveAllGuardians();
ValueTask<Guardian> ModifyGuardianAsync(Guardian guardian); |
<<<<<<<
using OtripleS.Web.Api.Services.Students;
=======
using OtripleS.Web.Api.Services;
using OtripleS.Web.Api.Services.Teachers;
>>>>>>>
using OtripleS.Web.Api.Services.Students;
using OtripleS.Web.Api.Services.Teachers; |
<<<<<<<
[HttpPut]
public async ValueTask<ActionResult<Teacher>> PutTeacher(Teacher teacher)
{
try
{
Teacher updatedTeacher =
await this.teacherService.ModifyTeacherAsync(teacher);
return Ok(updatedTeacher);
}
catch (TeacherValidationException teacherValidationException)
when (teacherValidationException.InnerException is NotFoundTeacherException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return NotFound(innerMessage);
}
catch (TeacherValidationException teacherValidationException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return BadRequest(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
when (teacherDependencyException.InnerException is LockedTeacherException)
{
string innerMessage = GetInnerMessage(teacherDependencyException);
return Locked(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
[HttpGet]
public ActionResult<IQueryable<Teacher>> GetAllTeachers()
{
try
{
IQueryable<Teacher> teachers =
this.teacherService.RetrieveAllTeachers();
return Ok(teachers);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
public static string GetInnerMessage(Exception exception) =>
exception.InnerException.Message;
=======
[HttpDelete("{teacherId}")]
public async ValueTask<ActionResult<Teacher>> DeleteTeacherAsync(Guid teacherId)
{
try
{
Teacher storageTeacher =
await this.teacherService.DeleteTeacherByIdAsync(teacherId);
return Ok(storageTeacher);
}
catch (TeacherValidationException teacherValidationException)
when (teacherValidationException.InnerException is NotFoundTeacherException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return NotFound(innerMessage);
}
catch (TeacherValidationException teacherValidationException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return BadRequest(teacherValidationException);
}
catch (TeacherDependencyException teacherDependencyException)
when (teacherDependencyException.InnerException is LockedTeacherException)
{
string innerMessage = GetInnerMessage(teacherDependencyException);
return Locked(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
[HttpPost]
public async ValueTask<ActionResult<Teacher>> PostTeacherAsync(
[FromBody] Teacher teacher)
{
try
{
Teacher persistedTeacher =
await this.teacherService.CreateTeacherAsync(teacher);
return Ok(persistedTeacher);
}
catch (TeacherValidationException teacherValidationException)
when (teacherValidationException.InnerException is AlreadyExistsTeacherException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return Conflict(innerMessage);
}
catch (TeacherValidationException teacherValidationException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return BadRequest(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
public static string GetInnerMessage(Exception exception) =>
exception.InnerException.Message;
>>>>>>>
[HttpPost]
public async ValueTask<ActionResult<Teacher>> PostTeacherAsync(
[FromBody] Teacher teacher)
{
try
{
Teacher persistedTeacher =
await this.teacherService.CreateTeacherAsync(teacher);
return Ok(persistedTeacher);
}
catch (TeacherValidationException teacherValidationException)
when (teacherValidationException.InnerException is AlreadyExistsTeacherException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return Conflict(innerMessage);
}
catch (TeacherValidationException teacherValidationException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return BadRequest(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
[HttpPut]
public async ValueTask<ActionResult<Teacher>> PutTeacher(Teacher teacher)
{
try
{
Teacher updatedTeacher =
await this.teacherService.ModifyTeacherAsync(teacher);
return Ok(updatedTeacher);
}
catch (TeacherValidationException teacherValidationException)
when (teacherValidationException.InnerException is NotFoundTeacherException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return NotFound(innerMessage);
}
catch (TeacherValidationException teacherValidationException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return BadRequest(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
when (teacherDependencyException.InnerException is LockedTeacherException)
{
string innerMessage = GetInnerMessage(teacherDependencyException);
return Locked(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
[HttpGet]
public ActionResult<IQueryable<Teacher>> GetAllTeachers()
{
try
{
IQueryable<Teacher> teachers =
this.teacherService.RetrieveAllTeachers();
return Ok(teachers);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
[HttpDelete("{teacherId}")]
public async ValueTask<ActionResult<Teacher>> DeleteTeacherAsync(Guid teacherId)
{
try
{
Teacher storageTeacher =
await this.teacherService.DeleteTeacherByIdAsync(teacherId);
return Ok(storageTeacher);
}
catch (TeacherValidationException teacherValidationException)
when (teacherValidationException.InnerException is NotFoundTeacherException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return NotFound(innerMessage);
}
catch (TeacherValidationException teacherValidationException)
{
string innerMessage = GetInnerMessage(teacherValidationException);
return BadRequest(teacherValidationException);
}
catch (TeacherDependencyException teacherDependencyException)
when (teacherDependencyException.InnerException is LockedTeacherException)
{
string innerMessage = GetInnerMessage(teacherDependencyException);
return Locked(innerMessage);
}
catch (TeacherDependencyException teacherDependencyException)
{
return Problem(teacherDependencyException.Message);
}
catch (TeacherServiceException teacherServiceException)
{
return Problem(teacherServiceException.Message);
}
}
public static string GetInnerMessage(Exception exception) =>
exception.InnerException.Message; |
<<<<<<<
using System;
using System.Threading.Tasks;
=======
>>>>>>>
<<<<<<<
=======
using Force.DeepCloner;
>>>>>>>
using Force.DeepCloner;
<<<<<<<
=======
using System;
using System.Threading.Tasks;
>>>>>>>
using System;
using System.Threading.Tasks;
<<<<<<<
public async Task ShouldCreateCourseAsync()
{
// given
DateTimeOffset dateTime = DateTimeOffset.UtcNow;
Course randomCourse = CreateRandomCourse(dateTime);
randomCourse.UpdatedBy = randomCourse.CreatedBy;
randomCourse.UpdatedDate = randomCourse.CreatedDate;
Course inputCourse = randomCourse;
Course storageCourse = randomCourse;
Course expectedCourse = randomCourse;
this.dateTimeBrokerMock.Setup(broker =>
broker.GetCurrentDateTime())
.Returns(dateTime);
this.storageBrokerMock.Setup(broker =>
broker.InsertCourseAsync(inputCourse))
.ReturnsAsync(storageCourse);
// when
Course actualCourse =
await this.courseService.CreateCourseAsync(inputCourse);
// then
actualCourse.Should().BeEquivalentTo(expectedCourse);
this.storageBrokerMock.Verify(broker =>
broker.InsertCourseAsync(inputCourse),
Times.Once);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact]
=======
public async Task ShouldModifyCourseAsync()
{
// given
int randomNumber = GetRandomNumber();
int randomDays = randomNumber;
DateTimeOffset randomDate = GetRandomDateTime();
DateTimeOffset randomInputDate = GetRandomDateTime();
Course randomCourse = CreateRandomCourse(randomInputDate);
Course inputCourse = randomCourse;
Course afterUpdateStorageCourse = inputCourse;
Course expectedCourse = afterUpdateStorageCourse;
Course beforeUpdateStorageCourse = randomCourse.DeepClone();
inputCourse.UpdatedDate = randomDate;
Guid courseId = inputCourse.Id;
this.dateTimeBrokerMock.Setup(broker =>
broker.GetCurrentDateTime())
.Returns(randomDate);
this.storageBrokerMock.Setup(broker =>
broker.SelectCourseByIdAsync(courseId))
.ReturnsAsync(beforeUpdateStorageCourse);
this.storageBrokerMock.Setup(broker =>
broker.UpdateCourseAsync(inputCourse))
.ReturnsAsync(afterUpdateStorageCourse);
// when
Course actualCourse =
await this.courseService.ModifyCourseAsync(inputCourse);
// then
actualCourse.Should().BeEquivalentTo(expectedCourse);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Once);
this.storageBrokerMock.Verify(broker =>
broker.SelectCourseByIdAsync(courseId),
Times.Once);
this.storageBrokerMock.Verify(broker =>
broker.UpdateCourseAsync(inputCourse),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact]
>>>>>>>
public async Task ShouldCreateCourseAsync()
{
// given
DateTimeOffset dateTime = DateTimeOffset.UtcNow;
Course randomCourse = CreateRandomCourse(dateTime);
randomCourse.UpdatedBy = randomCourse.CreatedBy;
randomCourse.UpdatedDate = randomCourse.CreatedDate;
Course inputCourse = randomCourse;
Course storageCourse = randomCourse;
Course expectedCourse = randomCourse;
this.dateTimeBrokerMock.Setup(broker =>
broker.GetCurrentDateTime())
.Returns(dateTime);
this.storageBrokerMock.Setup(broker =>
broker.InsertCourseAsync(inputCourse))
.ReturnsAsync(storageCourse);
// when
Course actualCourse =
await this.courseService.CreateCourseAsync(inputCourse);
// then
actualCourse.Should().BeEquivalentTo(expectedCourse);
this.storageBrokerMock.Verify(broker =>
broker.InsertCourseAsync(inputCourse),
Times.Once);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact]
public async Task ShouldModifyCourseAsync()
{
// given
int randomNumber = GetRandomNumber();
int randomDays = randomNumber;
DateTimeOffset randomDate = GetRandomDateTime();
DateTimeOffset randomInputDate = GetRandomDateTime();
Course randomCourse = CreateRandomCourse(randomInputDate);
Course inputCourse = randomCourse;
Course afterUpdateStorageCourse = inputCourse;
Course expectedCourse = afterUpdateStorageCourse;
Course beforeUpdateStorageCourse = randomCourse.DeepClone();
inputCourse.UpdatedDate = randomDate;
Guid courseId = inputCourse.Id;
this.dateTimeBrokerMock.Setup(broker =>
broker.GetCurrentDateTime())
.Returns(randomDate);
this.storageBrokerMock.Setup(broker =>
broker.SelectCourseByIdAsync(courseId))
.ReturnsAsync(beforeUpdateStorageCourse);
this.storageBrokerMock.Setup(broker =>
broker.UpdateCourseAsync(inputCourse))
.ReturnsAsync(afterUpdateStorageCourse);
// when
Course actualCourse =
await this.courseService.ModifyCourseAsync(inputCourse);
// then
actualCourse.Should().BeEquivalentTo(expectedCourse);
this.dateTimeBrokerMock.Verify(broker =>
broker.GetCurrentDateTime(),
Times.Once);
this.storageBrokerMock.Verify(broker =>
broker.SelectCourseByIdAsync(courseId),
Times.Once);
this.storageBrokerMock.Verify(broker =>
broker.UpdateCourseAsync(inputCourse),
Times.Once);
this.storageBrokerMock.VerifyNoOtherCalls();
this.loggingBrokerMock.VerifyNoOtherCalls();
this.dateTimeBrokerMock.VerifyNoOtherCalls();
}
[Fact] |
<<<<<<<
public partial class ContactService
{
private void ValidateContactOnCreate(Contact contact)
{
ValidateContactIsNotNull(contact);
ValidateContactId(contact);
ValidateContactAuditFields(contact);
ValidateContactAuditFieldsOnCreate(contact);
}
private static void ValidateContactAuditFields(Contact contact)
{
switch(contact)
{
case { } when IsInvalid(contact.CreatedBy):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedBy),
parameterValue: contact.CreatedBy);
case { } when IsInvalid(contact.CreatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: contact.CreatedDate);
case { } when IsInvalid(contact.UpdatedBy):
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedBy),
parameterValue: contact.UpdatedBy);
case { } when IsInvalid(contact.UpdatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
private void ValidateContactAuditFieldsOnCreate(Contact contact)
{
switch (contact)
{
case { } when contact.UpdatedBy != contact.CreatedBy:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedBy),
parameterValue: contact.UpdatedBy);
case { } when contact.UpdatedDate != contact.CreatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
case { } when IsDateNotRecent(contact.CreatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: contact.CreatedDate);
}
}
private static void ValidateContactId(Contact contact)
{
if (IsInvalid(contact.Id))
{
throw new InvalidContactException(
parameterName: nameof(Contact.Id),
parameterValue: contact.Id);
}
}
private static void ValidateIdIsNull(Guid contactId)
{
if (IsInvalid(contactId))
{
throw new InvalidContactException(
parameterName: nameof(Contact.Id),
parameterValue: contactId);
}
}
private static void ValidateContactIsNotNull(Contact contact)
{
if (contact is null)
{
throw new NullContactException();
}
}
private bool IsDateNotRecent(DateTimeOffset dateTime)
{
DateTimeOffset now = this.dateTimeBroker.GetCurrentDateTime();
int oneMinute = 1;
TimeSpan difference = now.Subtract(dateTime);
return Math.Abs(difference.TotalMinutes) > oneMinute;
}
private static bool IsInvalid(DateTimeOffset inputDate) => inputDate == default;
private static bool IsInvalid(Guid input) => input == Guid.Empty;
private void ValidateStorageContacts(IQueryable<Contact> storageContacts)
{
if (storageContacts.Count() == 0)
{
this.loggingBroker.LogWarning("No contacts found in storage.");
}
}
private void ValidateStorageContact(Contact storageContact, Guid contactId)
{
if (storageContact is null)
{
throw new NotFoundContactException(contactId);
}
}
}
=======
public partial class ContactService
{
private void ValidateContactOnCreate(Contact contact)
{
ValidateContactIsNotNull(contact);
ValidateContactId(contact);
ValidateContactAuditFields(contact);
ValidateContactAuditFieldsOnCreate(contact);
}
private void ValidateContactOnModify(Contact contact)
{
ValidateContactIsNotNull(contact);
ValidateContactId(contact);
ValidateContactAuditFields(contact);
ValidateDatesAreNotSame(contact);
ValidateUpdatedDateIsRecent(contact);
}
private void ValidateStorageContact(Contact storageContact, Guid contactId)
{
if (storageContact == null)
{
throw new NotFoundContactException(contactId);
}
}
private void ValidateAgainstStorageContactOnModify(Contact inputContact, Contact storageContact)
{
switch (inputContact)
{
case { } when inputContact.CreatedDate != storageContact.CreatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: inputContact.CreatedDate);
case { } when inputContact.CreatedBy != storageContact.CreatedBy:
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedBy),
parameterValue: inputContact.CreatedBy);
case { } when inputContact.UpdatedDate == storageContact.UpdatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: inputContact.UpdatedDate);
}
}
private void ValidateDatesAreNotSame(Contact contact)
{
if (contact.CreatedDate == contact.UpdatedDate)
{
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
private void ValidateUpdatedDateIsRecent(Contact contact)
{
if (IsDateNotRecent(contact.UpdatedDate))
{
throw new InvalidContactException(
parameterName: nameof(contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
private static void ValidateContactAuditFields(Contact contact)
{
switch (contact)
{
case { } when IsInvalid(contact.CreatedBy):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedBy),
parameterValue: contact.CreatedBy);
case { } when IsInvalid(contact.CreatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: contact.CreatedDate);
case { } when IsInvalid(contact.UpdatedBy):
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedBy),
parameterValue: contact.UpdatedBy);
case { } when IsInvalid(contact.UpdatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
private void ValidateContactAuditFieldsOnCreate(Contact contact)
{
switch (contact)
{
case { } when contact.UpdatedBy != contact.CreatedBy:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedBy),
parameterValue: contact.UpdatedBy);
case { } when contact.UpdatedDate != contact.CreatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
case { } when IsDateNotRecent(contact.CreatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: contact.CreatedDate);
}
}
private static void ValidateContactId(Contact contact)
{
if (IsInvalid(contact.Id))
{
throw new InvalidContactException(
parameterName: nameof(Contact.Id),
parameterValue: contact.Id);
}
}
private static void ValidateContactIsNotNull(Contact contact)
{
if (contact is null)
{
throw new NullContactException();
}
}
private bool IsDateNotRecent(DateTimeOffset dateTime)
{
DateTimeOffset now = this.dateTimeBroker.GetCurrentDateTime();
int oneMinute = 1;
TimeSpan difference = now.Subtract(dateTime);
return Math.Abs(difference.TotalMinutes) > oneMinute;
}
private static bool IsInvalid(DateTimeOffset inputDate) => inputDate == default;
private static bool IsInvalid(Guid input) => input == Guid.Empty;
private void ValidateStorageContacts(IQueryable<Contact> storageContacts)
{
if (storageContacts.Count() == 0)
{
this.loggingBroker.LogWarning("No contacts found in storage.");
}
}
}
>>>>>>>
public partial class ContactService
{
private void ValidateContactOnCreate(Contact contact)
{
ValidateContactIsNotNull(contact);
ValidateContactId(contact);
ValidateContactAuditFields(contact);
ValidateContactAuditFieldsOnCreate(contact);
}
private static void ValidateContactAuditFields(Contact contact)
{
switch(contact)
{
case { } when IsInvalid(contact.CreatedBy):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedBy),
parameterValue: contact.CreatedBy);
case { } when IsInvalid(contact.CreatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: contact.CreatedDate);
case { } when IsInvalid(contact.UpdatedBy):
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedBy),
parameterValue: contact.UpdatedBy);
case { } when IsInvalid(contact.UpdatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
private void ValidateContactAuditFieldsOnCreate(Contact contact)
{
switch (contact)
{
case { } when contact.UpdatedBy != contact.CreatedBy:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedBy),
parameterValue: contact.UpdatedBy);
case { } when contact.UpdatedDate != contact.CreatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
case { } when IsDateNotRecent(contact.CreatedDate):
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: contact.CreatedDate);
}
}
private static void ValidateContactId(Contact contact)
{
if (IsInvalid(contact.Id))
{
throw new InvalidContactException(
parameterName: nameof(Contact.Id),
parameterValue: contact.Id);
}
}
private static void ValidateIdIsNull(Guid contactId)
{
if (IsInvalid(contactId))
{
throw new InvalidContactException(
parameterName: nameof(Contact.Id),
parameterValue: contactId);
}
}
private static void ValidateContactIsNotNull(Contact contact)
{
if (contact is null)
{
throw new NullContactException();
}
}
private bool IsDateNotRecent(DateTimeOffset dateTime)
{
DateTimeOffset now = this.dateTimeBroker.GetCurrentDateTime();
int oneMinute = 1;
TimeSpan difference = now.Subtract(dateTime);
return Math.Abs(difference.TotalMinutes) > oneMinute;
}
private static bool IsInvalid(DateTimeOffset inputDate) => inputDate == default;
private static bool IsInvalid(Guid input) => input == Guid.Empty;
private void ValidateStorageContacts(IQueryable<Contact> storageContacts)
{
if (storageContacts.Count() == 0)
{
this.loggingBroker.LogWarning("No contacts found in storage.");
}
}
private void ValidateStorageContact(Contact storageContact, Guid contactId)
{
if (storageContact is null)
{
throw new NotFoundContactException(contactId);
}
}
private void ValidateContactOnModify(Contact contact)
{
ValidateContactIsNotNull(contact);
ValidateContactId(contact);
ValidateContactAuditFields(contact);
ValidateDatesAreNotSame(contact);
ValidateUpdatedDateIsRecent(contact);
}
private void ValidateAgainstStorageContactOnModify(Contact inputContact, Contact storageContact)
{
switch (inputContact)
{
case { } when inputContact.CreatedDate != storageContact.CreatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedDate),
parameterValue: inputContact.CreatedDate);
case { } when inputContact.CreatedBy != storageContact.CreatedBy:
throw new InvalidContactException(
parameterName: nameof(Contact.CreatedBy),
parameterValue: inputContact.CreatedBy);
case { } when inputContact.UpdatedDate == storageContact.UpdatedDate:
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: inputContact.UpdatedDate);
}
}
private void ValidateDatesAreNotSame(Contact contact)
{
if (contact.CreatedDate == contact.UpdatedDate)
{
throw new InvalidContactException(
parameterName: nameof(Contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
private void ValidateUpdatedDateIsRecent(Contact contact)
{
if (IsDateNotRecent(contact.UpdatedDate))
{
throw new InvalidContactException(
parameterName: nameof(contact.UpdatedDate),
parameterValue: contact.UpdatedDate);
}
}
} |
<<<<<<<
IQueryable<StudentSemesterCourse> RetrieveAllStudentSemesterCourses();
=======
ValueTask<StudentSemesterCourse> DeleteStudentSemesterCourseAsync(Guid semesterCourseId, Guid studentId);
>>>>>>>
IQueryable<StudentSemesterCourse> RetrieveAllStudentSemesterCourses();
ValueTask<StudentSemesterCourse> DeleteStudentSemesterCourseAsync(Guid semesterCourseId, Guid studentId); |
<<<<<<<
ValueTask<StudentGuardian> RetrieveStudentGuardianByIdAsync(Guid studentId, Guid guardianId);
}
=======
ValueTask<StudentGuardian> AddStudentGuardianAsync(StudentGuardian studentGuardian);
}
>>>>>>>
ValueTask<StudentGuardian> RetrieveStudentGuardianByIdAsync(Guid studentId, Guid guardianId);
ValueTask<StudentGuardian> AddStudentGuardianAsync(StudentGuardian studentGuardian);
} |
<<<<<<<
private void ValidateStorageExamAttachment(
ExamAttachment storageExamAttachment,
Guid examId,
Guid attachmentId)
{
if (storageExamAttachment == null)
throw new NotFoundExamAttachmentException(examId, attachmentId);
}
private bool IsInvalid(Guid input) => input == default;
=======
private void ValidateStorageExamAttachments(IQueryable<ExamAttachment> storageExamAttachments)
{
if (storageExamAttachments.Count() == 0)
{
this.loggingBroker.LogWarning("No exam attachments found in storage.");
}
}
>>>>>>>
private void ValidateStorageExamAttachment(
ExamAttachment storageExamAttachment,
Guid examId,
Guid attachmentId)
{
if (storageExamAttachment == null)
throw new NotFoundExamAttachmentException(examId, attachmentId);
}
private void ValidateStorageExamAttachments(IQueryable<ExamAttachment> storageExamAttachments)
{
if (storageExamAttachments.Count() == 0)
{
this.loggingBroker.LogWarning("No exam attachments found in storage.");
}
}
private bool IsInvalid(Guid input) => input == default; |
<<<<<<<
using Autofac;
using DI;
=======
using System.Web.Mvc;
using System.Web.Routing;
using Autofac.Integration.Mvc;
>>>>>>>
using System.Web.Mvc;
using System.Web.Routing;
using Autofac;
using Autofac.Integration.Mvc;
using DI;
<<<<<<<
// DI
ContainerBuilder builder = new ContainerBuilder();
builder.RegisterType<IDialogInvoker>().As<DialogInvoker>();
GlobalConfiguration.Configure((config) => WebApiConfig.Register(config, builder));
=======
// Web API configuration and services
var container = Bootstrap.Build(this.Context.IsDebuggingEnabled);
GlobalConfiguration.Configure(c => WebApiConfig.Register(c, container));
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
// BundleConfig.RegisterBundles(BundleTable.Bundles);
>>>>>>>
// Web API configuration and services
ContainerBuilder builder = new ContainerBuilder();
builder.RegisterType<IDialogInvoker>().As<DialogInvoker>();
var container = Bootstrap.Build(builder, this.Context.IsDebuggingEnabled);
GlobalConfiguration.Configure(c => WebApiConfig.Register(c, container));
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
// BundleConfig.RegisterBundles(BundleTable.Bundles); |
<<<<<<<
private static void ValidateStorageTeacherAttachment(
TeacherAttachment storageTeacherAttachment,
Guid studentId,
Guid attachmentId)
{
if (storageTeacherAttachment == null)
{
throw new NotFoundTeacherAttachmentException(studentId, attachmentId);
}
}
private void ValidateStorageTeacherAttachments(IQueryable<TeacherAttachment> storageTeacherAttachments)
{
if (storageTeacherAttachments.Count() == 0)
{
this.loggingBroker.LogWarning("No teacher attachments found in storage.");
}
}
=======
private static void ValidateStorageTeacherAttachment(
TeacherAttachment storageTeacherAttachment,
Guid studentId,
Guid attachmentId)
{
if (storageTeacherAttachment is null)
{
throw new NotFoundTeacherAttachmentException(studentId, attachmentId);
}
}
>>>>>>>
private static void ValidateStorageTeacherAttachment(
TeacherAttachment storageTeacherAttachment,
Guid studentId,
Guid attachmentId)
{
if (storageTeacherAttachment is null)
{
throw new NotFoundTeacherAttachmentException(studentId, attachmentId);
}
}
private void ValidateStorageTeacherAttachments(IQueryable<TeacherAttachment> storageTeacherAttachments)
{
if (storageTeacherAttachments.Count() == 0)
{
this.loggingBroker.LogWarning("No teacher attachments found in storage.");
}
} |
<<<<<<<
=======
using System;
using System.Linq;
using System.Threading.Tasks;
>>>>>>>
using System;
using System.Linq;
using System.Threading.Tasks; |
<<<<<<<
=======
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
>>>>>>>
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
<<<<<<<
using System;
using System.Linq;
using System.Threading.Tasks;
=======
using OtripleS.Web.Api.Models.Classrooms.Exceptions;
>>>>>>>
using OtripleS.Web.Api.Models.Classrooms.Exceptions;
using System;
using System.Linq;
using System.Threading.Tasks;
<<<<<<<
return storageClassrooms;
});
=======
return storageClassrooms;
});
public ValueTask<Classroom> RetrieveClassroomById(Guid classroomId) =>
TryCatch(async () =>
{
ValidateClassroomId(classroomId);
Classroom storageClassroom = await this.storageBroker.SelectClassroomByIdAsync(classroomId);
ValidateStorageClassroom(storageClassroom, classroomId);
return storageClassroom;
});
>>>>>>>
return storageClassrooms;
});
public ValueTask<Classroom> RetrieveClassroomById(Guid classroomId) =>
TryCatch(async () =>
{
ValidateClassroomId(classroomId);
Classroom storageClassroom = await this.storageBroker.SelectClassroomByIdAsync(classroomId);
ValidateStorageClassroom(storageClassroom, classroomId);
return storageClassroom;
}); |
<<<<<<<
public ValueTask<StudentSemesterCourse> CreateStudentSemesterCourseAsync(StudentSemesterCourse inputStudentSemesterCourse);
ValueTask<StudentSemesterCourse> RetrieveStudentSemesterCourseByIdAsync(Guid studentId, Guid SemesterCourseId);
=======
ValueTask<StudentSemesterCourse> RetrieveStudentSemesterCourseByIdAsync(Guid studentId, Guid semesterCourse);
ValueTask<StudentSemesterCourse> CreateStudentSemesterCourseAsync(
StudentSemesterCourse inputStudentSemesterCourse);
>>>>>>>
ValueTask<StudentSemesterCourse> CreateStudentSemesterCourseAsync(StudentSemesterCourse inputStudentSemesterCourse);
ValueTask<StudentSemesterCourse> RetrieveStudentSemesterCourseByIdAsync(Guid studentId, Guid SemesterCourseId); |
<<<<<<<
public partial class GuardianService
{
private void ValidateGuardianId(Guid guardianId)
{
if (guardianId == default)
{
throw new InvalidGuardianException(
parameterName: nameof(Guardian.Id),
parameterValue: guardianId);
}
}
private void ValidateStorageGuardian(Guardian storageGuardian, Guid guardianId)
{
if (storageGuardian == null)
{
throw new NotFoundGuardianException(guardianId);
}
}
private void ValidateGuardianOnModify(Guardian guardian)
{
ValidateGuardian(guardian);
ValidateGuardianId(guardian.Id);
ValidateGuardianIds(guardian);
ValidateGuardianDates(guardian);
ValidateDatesAreNotSame(guardian);
ValidateUpdatedDateIsRecent(guardian);
}
private void ValidateGuardian(Guardian guardian)
{
if (guardian == null)
{
throw new NullGuardianException();
}
}
private void ValidateGuardianIds(Guardian guardian)
{
switch (guardian)
{
case { } when IsInvalid(guardian.CreatedBy):
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedBy),
parameterValue: guardian.CreatedBy);
case { } when IsInvalid(guardian.UpdatedBy):
throw new InvalidGuardianException(
parameterName: nameof(Guardian.UpdatedBy),
parameterValue: guardian.UpdatedBy);
}
}
private void ValidateGuardianDates(Guardian guardian)
{
switch (guardian)
{
case { } when guardian.CreatedDate == default:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedDate),
parameterValue: guardian.CreatedDate);
case { } when guardian.UpdatedDate == default:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.UpdatedDate),
parameterValue: guardian.UpdatedDate);
}
}
private void ValidateDatesAreNotSame(Guardian guardian)
{
if (guardian.CreatedDate == guardian.UpdatedDate)
{
throw new InvalidGuardianException(
parameterName: nameof(guardian.UpdatedDate),
parameterValue: guardian.UpdatedDate);
}
}
private void ValidateUpdatedDateIsRecent(Guardian guardian)
{
if (IsDateNotRecent(guardian.UpdatedDate))
{
throw new InvalidGuardianException(
parameterName: nameof(guardian.UpdatedDate),
parameterValue: guardian.UpdatedDate);
}
}
private void ValidateAgainstStorageGuardianOnModify(Guardian inputGuardian, Guardian storageGuardian)
{
switch (inputGuardian)
{
case { } when inputGuardian.CreatedDate != storageGuardian.CreatedDate:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedDate),
parameterValue: inputGuardian.CreatedDate);
case { } when inputGuardian.CreatedBy != storageGuardian.CreatedBy:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedBy),
parameterValue: inputGuardian.CreatedBy);
case { } when inputGuardian.UpdatedDate == storageGuardian.UpdatedDate:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.UpdatedDate),
parameterValue: inputGuardian.UpdatedDate);
}
}
private bool IsDateNotRecent(DateTimeOffset dateTime)
{
DateTimeOffset now = this.dateTimeBroker.GetCurrentDateTime();
int oneMinute = 1;
TimeSpan difference = now.Subtract(dateTime);
return Math.Abs(difference.TotalMinutes) > oneMinute;
}
private static bool IsInvalid(Guid input) => input == default;
}
=======
public partial class GuardianService
{
private void ValidateGuardianId(Guid guardianId)
{
if (guardianId == default)
{
throw new InvalidGuardianException(
parameterName: nameof(Guardian.Id),
parameterValue: guardianId);
}
}
private void ValidateStorageGuardian(Guardian storageGuardian, Guid guardianId)
{
if (storageGuardian == null)
{
throw new NotFoundGuardianException(guardianId);
}
}
private void ValidateStorageGuardians(IQueryable<Guardian> storageGuardians)
{
if (storageGuardians.Count() == 0)
{
this.loggingBroker.LogWarning("No guardians found in storage.");
}
}
}
>>>>>>>
public partial class GuardianService
{
private void ValidateGuardianId(Guid guardianId)
{
if (guardianId == default)
{
throw new InvalidGuardianException(
parameterName: nameof(Guardian.Id),
parameterValue: guardianId);
}
}
private void ValidateStorageGuardian(Guardian storageGuardian, Guid guardianId)
{
if (storageGuardian == null)
{
throw new NotFoundGuardianException(guardianId);
}
}
private void ValidateGuardianOnModify(Guardian guardian)
{
ValidateGuardian(guardian);
ValidateGuardianId(guardian.Id);
ValidateGuardianIds(guardian);
ValidateGuardianDates(guardian);
ValidateDatesAreNotSame(guardian);
ValidateUpdatedDateIsRecent(guardian);
}
private void ValidateGuardian(Guardian guardian)
{
if (guardian == null)
{
throw new NullGuardianException();
}
}
private void ValidateGuardianIds(Guardian guardian)
{
switch (guardian)
{
case { } when IsInvalid(guardian.CreatedBy):
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedBy),
parameterValue: guardian.CreatedBy);
case { } when IsInvalid(guardian.UpdatedBy):
throw new InvalidGuardianException(
parameterName: nameof(Guardian.UpdatedBy),
parameterValue: guardian.UpdatedBy);
}
}
private void ValidateGuardianDates(Guardian guardian)
{
switch (guardian)
{
case { } when guardian.CreatedDate == default:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedDate),
parameterValue: guardian.CreatedDate);
case { } when guardian.UpdatedDate == default:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.UpdatedDate),
parameterValue: guardian.UpdatedDate);
}
}
private void ValidateDatesAreNotSame(Guardian guardian)
{
if (guardian.CreatedDate == guardian.UpdatedDate)
{
throw new InvalidGuardianException(
parameterName: nameof(guardian.UpdatedDate),
parameterValue: guardian.UpdatedDate);
}
}
private void ValidateUpdatedDateIsRecent(Guardian guardian)
{
if (IsDateNotRecent(guardian.UpdatedDate))
{
throw new InvalidGuardianException(
parameterName: nameof(guardian.UpdatedDate),
parameterValue: guardian.UpdatedDate);
}
}
private void ValidateAgainstStorageGuardianOnModify(Guardian inputGuardian, Guardian storageGuardian)
{
switch (inputGuardian)
{
case { } when inputGuardian.CreatedDate != storageGuardian.CreatedDate:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedDate),
parameterValue: inputGuardian.CreatedDate);
case { } when inputGuardian.CreatedBy != storageGuardian.CreatedBy:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.CreatedBy),
parameterValue: inputGuardian.CreatedBy);
case { } when inputGuardian.UpdatedDate == storageGuardian.UpdatedDate:
throw new InvalidGuardianException(
parameterName: nameof(Guardian.UpdatedDate),
parameterValue: inputGuardian.UpdatedDate);
}
}
private bool IsDateNotRecent(DateTimeOffset dateTime)
{
DateTimeOffset now = this.dateTimeBroker.GetCurrentDateTime();
int oneMinute = 1;
TimeSpan difference = now.Subtract(dateTime);
return Math.Abs(difference.TotalMinutes) > oneMinute;
}
private static bool IsInvalid(Guid input) => input == default;
private void ValidateStorageGuardians(IQueryable<Guardian> storageGuardians)
{
if (storageGuardians.Count() == 0)
{
this.loggingBroker.LogWarning("No guardians found in storage.");
}
}
} |
<<<<<<<
ValueTask<Course> DeleteCourseAsync(Guid courseId);
IQueryable<Course> RetrieveAllCourses();
ValueTask<Course> RetrieveCourseById(Guid courseId);
=======
ValueTask<Course> ModifyCourseAsync(Course course);
ValueTask<Course> DeleteCourseAsync(Guid CourseId);
>>>>>>>
IQueryable<Course> RetrieveAllCourses();
ValueTask<Course> RetrieveCourseById(Guid courseId);
ValueTask<Course> ModifyCourseAsync(Course course);
ValueTask<Course> DeleteCourseAsync(Guid CourseId); |
<<<<<<<
using System;
using System.Linq;
=======
>>>>>>>
using System.Linq;
<<<<<<<
private void ValidateStorageCourses(IQueryable<Course> storageCourses)
{
if (storageCourses.Count() == 0)
{
this.loggingBroker.LogWarning("No courses found in storage.");
}
}
=======
private void ValidateCourse(Course course)
{
if (course is null)
{
throw new NullCourseException();
}
}
private void ValidateAgainstStorageCourseOnModify(Course inputCourse, Course storageCourse)
{
switch (inputCourse)
{
case { } when inputCourse.CreatedDate != storageCourse.CreatedDate:
throw new InvalidCourseInputException(
parameterName: nameof(Course.CreatedDate),
parameterValue: inputCourse.CreatedDate);
case { } when inputCourse.CreatedBy != storageCourse.CreatedBy:
throw new InvalidCourseInputException(
parameterName: nameof(Course.CreatedBy),
parameterValue: inputCourse.CreatedBy);
case { } when inputCourse.UpdatedDate == storageCourse.UpdatedDate:
throw new InvalidCourseInputException(
parameterName: nameof(Course.UpdatedDate),
parameterValue: inputCourse.UpdatedDate);
}
}
private static bool IsInvalid(string input) => String.IsNullOrWhiteSpace(input);
private static bool IsInvalid(Guid input) => input == default;
>>>>>>>
private void ValidateStorageCourses(IQueryable<Course> storageCourses)
{
if (storageCourses.Count() == 0)
{
this.loggingBroker.LogWarning("No courses found in storage.");
}
}
private void ValidateCourse(Course course)
{
if (course is null)
{
throw new NullCourseException();
}
}
private void ValidateAgainstStorageCourseOnModify(Course inputCourse, Course storageCourse)
{
switch (inputCourse)
{
case { } when inputCourse.CreatedDate != storageCourse.CreatedDate:
throw new InvalidCourseInputException(
parameterName: nameof(Course.CreatedDate),
parameterValue: inputCourse.CreatedDate);
case { } when inputCourse.CreatedBy != storageCourse.CreatedBy:
throw new InvalidCourseInputException(
parameterName: nameof(Course.CreatedBy),
parameterValue: inputCourse.CreatedBy);
case { } when inputCourse.UpdatedDate == storageCourse.UpdatedDate:
throw new InvalidCourseInputException(
parameterName: nameof(Course.UpdatedDate),
parameterValue: inputCourse.UpdatedDate);
}
}
private static bool IsInvalid(string input) => String.IsNullOrWhiteSpace(input);
private static bool IsInvalid(Guid input) => input == default; |
<<<<<<<
public ValueTask<CalendarEntry> DeleteCalendarEntryByIdAsync(Guid calendarEntryId)
{
throw new NotImplementedException();
}
public ValueTask<CalendarEntry> ModifyCalendarEntryAsync(CalendarEntry calendarEntry)
{
throw new NotImplementedException();
}
public IQueryable<CalendarEntry> RetrieveAllCalendarEntries() =>
TryCatch(() =>
{
IQueryable<CalendarEntry> storageCalendarEntries = this.storageBroker.SelectAllCalendarEntries();
=======
public ValueTask<CalendarEntry> DeleteCalendarEntryByIdAsync(Guid calendarEntryId) =>
TryCatch(async () =>
{
ValidateCalendarEntryId(calendarEntryId);
CalendarEntry maybeCalendarEntry =
await this.storageBroker.SelectCalendarEntryByIdAsync(calendarEntryId);
ValidateStorageCalendarEntry(maybeCalendarEntry, calendarEntryId);
return await this.storageBroker.DeleteCalendarEntryAsync(maybeCalendarEntry);
});
public IQueryable<CalendarEntry> RetrieveAllCalendarEntries() =>
TryCatch(() =>
{
IQueryable<CalendarEntry> storageCalendarEntries =
this.storageBroker.SelectAllCalendarEntries();
>>>>>>>
public ValueTask<CalendarEntry> ModifyCalendarEntryAsync(CalendarEntry calendarEntry)
{
throw new NotImplementedException();
}
public ValueTask<CalendarEntry> DeleteCalendarEntryByIdAsync(Guid calendarEntryId) =>
TryCatch(async () =>
{
ValidateCalendarEntryId(calendarEntryId);
CalendarEntry maybeCalendarEntry =
await this.storageBroker.SelectCalendarEntryByIdAsync(calendarEntryId);
ValidateStorageCalendarEntry(maybeCalendarEntry, calendarEntryId);
return await this.storageBroker.DeleteCalendarEntryAsync(maybeCalendarEntry);
});
public IQueryable<CalendarEntry> RetrieveAllCalendarEntries() =>
TryCatch(() =>
{
IQueryable<CalendarEntry> storageCalendarEntries =
this.storageBroker.SelectAllCalendarEntries();
<<<<<<<
return storageCalendarEntries;
});
public ValueTask<CalendarEntry> RetrieveCalendarEntryByIdAsync(Guid calendarEntryId)
{
throw new NotImplementedException();
}
=======
return storageCalendarEntries;
});
public ValueTask<CalendarEntry> RetrieveCalendarEntryByIdAsync(
Guid calendarEntryId) =>
TryCatch(async () =>
{
ValidateCalendarEntryId(calendarEntryId);
CalendarEntry storageCalendarEntry =
await this.storageBroker.SelectCalendarEntryByIdAsync(calendarEntryId);
ValidateStorageCalendarEntry(storageCalendarEntry, calendarEntryId);
return storageCalendarEntry;
});
>>>>>>>
return storageCalendarEntries;
});
public ValueTask<CalendarEntry> RetrieveCalendarEntryByIdAsync(
Guid calendarEntryId) =>
TryCatch(async () =>
{
ValidateCalendarEntryId(calendarEntryId);
CalendarEntry storageCalendarEntry =
await this.storageBroker.SelectCalendarEntryByIdAsync(calendarEntryId);
ValidateStorageCalendarEntry(storageCalendarEntry, calendarEntryId);
return storageCalendarEntry;
}); |
<<<<<<<
=======
string on = join.AssociationType.GetOnCondition(join.Alias, factory, enabledFilters);
SqlString condition = new SqlString();
if (last != null &&
IsManyToManyRoot(last) &&
((IQueryableCollection)last).ElementType == join.AssociationType)
{
// the current join represents the join between a many-to-many association table
// and its "target" table. Here we need to apply any additional filters
// defined specifically on the many-to-many
string manyToManyFilter = ((IQueryableCollection)last)
.GetManyToManyFilterFragment(join.Alias, enabledFilters);
condition = new SqlString("".Equals(manyToManyFilter)
? on
: "".Equals(on)
? manyToManyFilter
: on + " and " + manyToManyFilter);
}
else
{
// NH Different behavior : NH1179 and NH1293
// Apply filters for entity joins and Many-To-One association
var enabledForManyToOne = FilterHelper.GetEnabledForManyToOne(enabledFilters);
condition = new SqlString(string.IsNullOrEmpty(on) && (ForceFilter || enabledForManyToOne.Count > 0)
? join.Joinable.FilterFragment(join.Alias, enabledForManyToOne)
: on);
}
>>>>>>>
<<<<<<<
public JoinSequence AddJoin(FromElement fromElement)
{
joins.AddRange(fromElement.JoinSequence.joins);
return this;
}
=======
internal bool ForceFilter { get; set; }
>>>>>>>
internal bool ForceFilter { get; set; }
public JoinSequence AddJoin(FromElement fromElement)
{
joins.AddRange(fromElement.JoinSequence.joins);
return this;
} |
<<<<<<<
var retrieveOperation = TableOperation.Retrieve<ApiRegistrationTableEntity>(ApiRegistrationTableEntity.GetPartitionKey(ApiRegistrationKey.Default),
ApiRegistrationTableEntity.GetRowKey(ApiRegistrationKey.Default));
var retrievedResult = _table.Execute(retrieveOperation);
=======
var retrieveOperation = TableOperation.Retrieve<ApiRegistrationTableEntity>(ApiRegistrationTableEntity.GetPartitionKey(ApiRegistrationProviderType.Jasper),
ApiRegistrationTableEntity.GetRowKey(ApiRegistrationProviderType.Jasper));
var retrievedResult = _azureTableStorageClient.Execute(retrieveOperation);
>>>>>>>
var retrieveOperation = TableOperation.Retrieve<ApiRegistrationTableEntity>(ApiRegistrationTableEntity.GetPartitionKey(ApiRegistrationKey.Default),
ApiRegistrationTableEntity.GetRowKey(ApiRegistrationKey.Default));
var retrievedResult = _azureTableStorageClient.Execute(retrieveOperation); |
<<<<<<<
[Theory, Explicit("Bench")]
public void BenchTransactionAccess(bool inTransaction)
{
var currentTransaction = System.Transactions.Transaction.Current;
using (inTransaction ? new TransactionScope() : null)
using (var s = OpenSession())
{
var impl = s.GetSessionImplementation();
var transactionContext = impl.TransactionContext;
if (inTransaction)
s.JoinTransaction();
// warm-up
for (var i = 0; i < 10; i++)
currentTransaction = System.Transactions.Transaction.Current;
for (var i = 0; i < 10; i++)
transactionContext = impl.TransactionContext;
var sw = new Stopwatch();
for (var j = 0; j < 4; j++)
{
sw.Restart();
for (var i = 0; i < 10000; i++)
currentTransaction = System.Transactions.Transaction.Current;
sw.Stop();
Assert.That(currentTransaction, inTransaction ? Is.Not.Null : Is.Null);
Console.WriteLine($"Current transaction reads have taken {sw.Elapsed}");
sw.Restart();
for (var i = 0; i < 10000; i++)
transactionContext = impl.TransactionContext;
sw.Stop();
Assert.That(transactionContext, inTransaction ? Is.Not.Null : Is.Null);
Console.WriteLine($"Transaction context reads have taken {sw.Elapsed}");
}
}
}
=======
[Theory]
public void CanUseDependentTransaction(bool explicitFlush)
{
if (!TestDialect.SupportsDependentTransaction)
Assert.Ignore("Dialect does not support dependent transactions");
IgnoreIfUnsupported(explicitFlush);
try
{
using (var committable = new CommittableTransaction())
{
System.Transactions.Transaction.Current = committable;
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
using (var s = OpenSession())
{
if (!AutoJoinTransaction)
s.JoinTransaction();
s.Save(new Person());
if (explicitFlush)
s.Flush();
clone.Complete();
}
}
System.Transactions.Transaction.Current = committable;
committable.Commit();
}
}
finally
{
System.Transactions.Transaction.Current = null;
}
}
[Theory]
public void CanUseSessionWithManyDependentTransaction(bool explicitFlush)
{
if (!TestDialect.SupportsDependentTransaction)
Assert.Ignore("Dialect does not support dependent transactions");
IgnoreIfUnsupported(explicitFlush);
// ODBC with SQL-Server always causes system transactions to go distributed, which causes their transaction completion to run
// asynchronously. But ODBC enlistment also check the previous transaction in a way that do not guard against it
// being concurrently disposed of. See https://github.com/nhibernate/nhibernate-core/pull/1505 for more details.
if (Sfi.ConnectionProvider.Driver is OdbcDriver)
Assert.Ignore("ODBC sometimes fails on second scope by checking the previous transaction status, which may yield an object disposed exception");
// SAP HANA & SQL Anywhere .Net providers always cause system transactions to be distributed, causing them to
// complete on concurrent threads. This creates race conditions when chaining scopes, the subsequent scope usage
// finding the connection still enlisted in the previous transaction, its complete being still not finished
// on its own thread.
if (Sfi.ConnectionProvider.Driver is HanaDriverBase || Sfi.ConnectionProvider.Driver is SapSQLAnywhere17Driver)
Assert.Ignore("SAP HANA and SQL Anywhere scope handling causes concurrency issues preventing chaining scope usages.");
try
{
using (var s = WithOptions().ConnectionReleaseMode(ConnectionReleaseMode.OnClose).OpenSession())
{
using (var committable = new CommittableTransaction())
{
System.Transactions.Transaction.Current = committable;
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
if (!AutoJoinTransaction)
s.JoinTransaction();
// Acquire the connection
var count = s.Query<Person>().Count();
Assert.That(count, Is.EqualTo(0), "Unexpected initial entity count.");
clone.Complete();
}
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
if (!AutoJoinTransaction)
s.JoinTransaction();
s.Save(new Person());
if (explicitFlush)
s.Flush();
clone.Complete();
}
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
if (!AutoJoinTransaction)
s.JoinTransaction();
var count = s.Query<Person>().Count();
Assert.That(count, Is.EqualTo(1), "Unexpected entity count after committed insert.");
clone.Complete();
}
System.Transactions.Transaction.Current = committable;
committable.Commit();
}
}
}
finally
{
System.Transactions.Transaction.Current = null;
}
using (var s = OpenSession())
{
using (var tx = new TransactionScope())
{
if (!AutoJoinTransaction)
s.JoinTransaction();
var count = s.Query<Person>().Count();
Assert.That(count, Is.EqualTo(1), "Unexpected entity count after global commit.");
tx.Complete();
}
}
}
>>>>>>>
[Theory]
public void CanUseDependentTransaction(bool explicitFlush)
{
if (!TestDialect.SupportsDependentTransaction)
Assert.Ignore("Dialect does not support dependent transactions");
IgnoreIfUnsupported(explicitFlush);
try
{
using (var committable = new CommittableTransaction())
{
System.Transactions.Transaction.Current = committable;
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
using (var s = OpenSession())
{
if (!AutoJoinTransaction)
s.JoinTransaction();
s.Save(new Person());
if (explicitFlush)
s.Flush();
clone.Complete();
}
}
System.Transactions.Transaction.Current = committable;
committable.Commit();
}
}
finally
{
System.Transactions.Transaction.Current = null;
}
}
[Theory]
public void CanUseSessionWithManyDependentTransaction(bool explicitFlush)
{
if (!TestDialect.SupportsDependentTransaction)
Assert.Ignore("Dialect does not support dependent transactions");
IgnoreIfUnsupported(explicitFlush);
// ODBC with SQL-Server always causes system transactions to go distributed, which causes their transaction completion to run
// asynchronously. But ODBC enlistment also check the previous transaction in a way that do not guard against it
// being concurrently disposed of. See https://github.com/nhibernate/nhibernate-core/pull/1505 for more details.
if (Sfi.ConnectionProvider.Driver is OdbcDriver)
Assert.Ignore("ODBC sometimes fails on second scope by checking the previous transaction status, which may yield an object disposed exception");
// SAP HANA & SQL Anywhere .Net providers always cause system transactions to be distributed, causing them to
// complete on concurrent threads. This creates race conditions when chaining scopes, the subsequent scope usage
// finding the connection still enlisted in the previous transaction, its complete being still not finished
// on its own thread.
if (Sfi.ConnectionProvider.Driver is HanaDriverBase || Sfi.ConnectionProvider.Driver is SapSQLAnywhere17Driver)
Assert.Ignore("SAP HANA and SQL Anywhere scope handling causes concurrency issues preventing chaining scope usages.");
try
{
using (var s = WithOptions().ConnectionReleaseMode(ConnectionReleaseMode.OnClose).OpenSession())
{
using (var committable = new CommittableTransaction())
{
System.Transactions.Transaction.Current = committable;
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
if (!AutoJoinTransaction)
s.JoinTransaction();
// Acquire the connection
var count = s.Query<Person>().Count();
Assert.That(count, Is.EqualTo(0), "Unexpected initial entity count.");
clone.Complete();
}
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
if (!AutoJoinTransaction)
s.JoinTransaction();
s.Save(new Person());
if (explicitFlush)
s.Flush();
clone.Complete();
}
using (var clone = committable.DependentClone(DependentCloneOption.RollbackIfNotComplete))
{
System.Transactions.Transaction.Current = clone;
if (!AutoJoinTransaction)
s.JoinTransaction();
var count = s.Query<Person>().Count();
Assert.That(count, Is.EqualTo(1), "Unexpected entity count after committed insert.");
clone.Complete();
}
System.Transactions.Transaction.Current = committable;
committable.Commit();
}
}
}
finally
{
System.Transactions.Transaction.Current = null;
}
using (var s = OpenSession())
{
using (var tx = new TransactionScope())
{
if (!AutoJoinTransaction)
s.JoinTransaction();
var count = s.Query<Person>().Count();
Assert.That(count, Is.EqualTo(1), "Unexpected entity count after global commit.");
tx.Complete();
}
}
}
[Theory, Explicit("Bench")]
public void BenchTransactionAccess(bool inTransaction)
{
var currentTransaction = System.Transactions.Transaction.Current;
using (inTransaction ? new TransactionScope() : null)
using (var s = OpenSession())
{
var impl = s.GetSessionImplementation();
var transactionContext = impl.TransactionContext;
if (inTransaction)
s.JoinTransaction();
// warm-up
for (var i = 0; i < 10; i++)
currentTransaction = System.Transactions.Transaction.Current;
for (var i = 0; i < 10; i++)
transactionContext = impl.TransactionContext;
var sw = new Stopwatch();
for (var j = 0; j < 4; j++)
{
sw.Restart();
for (var i = 0; i < 10000; i++)
currentTransaction = System.Transactions.Transaction.Current;
sw.Stop();
Assert.That(currentTransaction, inTransaction ? Is.Not.Null : Is.Null);
Console.WriteLine($"Current transaction reads have taken {sw.Elapsed}");
sw.Restart();
for (var i = 0; i < 10000; i++)
transactionContext = impl.TransactionContext;
sw.Stop();
Assert.That(transactionContext, inTransaction ? Is.Not.Null : Is.Null);
Console.WriteLine($"Transaction context reads have taken {sw.Elapsed}");
}
}
} |
<<<<<<<
[Test(Description = "NH-3261")]
=======
[Test]
[Description("NH-3337")]
public void ProductWithDoubleStringContainsAndNotNull()
{
// Consider this WCF DS query will fail:
// http://.../Products()?$filter=substringof("23",Code) and substringof('2',Name)
//
// It will generate a LINQ expression similar to this:
//
//.Where(
// p =>
// ((p.Code == null ? (bool?)null : p.Code.Contains("23"))
// &&
// (p.Name == null ? (bool?)null : p.Name.Contains("2"))) == null
// ?
// false
// :
// ((p.Code == null ? (bool?)null : p.Code.Contains("23"))
// &&
// (p.Name == null ? (bool?)null : p.Name.Contains("2"))).Value
//)
//
// In C# we cannot use && on nullable booleans, but it is allowed when building
// expression trees, so we need to construct the query gradually.
var nullAsNullableBool = Expression.Constant(null, typeof(bool?));
var valueProperty = typeof (bool?).GetProperty("Value");
var quantityIsNull = ((Expression<Func<Product, bool>>)(x => x.QuantityPerUnit == null));
var nameIsNull = ((Expression<Func<Product, bool>>)(x => x.Name == null));
var quantityContains23 = ((Expression<Func<Product, bool?>>)(x => x.QuantityPerUnit.Contains("box")));
var nameContains2 = ((Expression<Func<Product, bool?>>)(x => x.Name.Contains("cha")));
var conjunction = Expression.AndAlso(Expression.Condition(quantityIsNull.Body, nullAsNullableBool, quantityContains23.Body),
Expression.Condition(nameIsNull.Body, nullAsNullableBool, nameContains2.Body));
var condition = Expression.Condition(Expression.Equal(conjunction, Expression.Constant(null)),
Expression.Constant(false),
Expression.MakeMemberAccess(conjunction, valueProperty));
var expr = Expression.Lambda<Func<Product, bool>>(condition, quantityIsNull.Parameters);
var results = db.Products.Where(expr).ToList();
Assert.That(results, Has.Count.EqualTo(1));
}
[Test]
>>>>>>>
[Test]
[Description("NH-3337")]
public void ProductWithDoubleStringContainsAndNotNull()
{
// Consider this WCF DS query will fail:
// http://.../Products()?$filter=substringof("23",Code) and substringof('2',Name)
//
// It will generate a LINQ expression similar to this:
//
//.Where(
// p =>
// ((p.Code == null ? (bool?)null : p.Code.Contains("23"))
// &&
// (p.Name == null ? (bool?)null : p.Name.Contains("2"))) == null
// ?
// false
// :
// ((p.Code == null ? (bool?)null : p.Code.Contains("23"))
// &&
// (p.Name == null ? (bool?)null : p.Name.Contains("2"))).Value
//)
//
// In C# we cannot use && on nullable booleans, but it is allowed when building
// expression trees, so we need to construct the query gradually.
var nullAsNullableBool = Expression.Constant(null, typeof(bool?));
var valueProperty = typeof (bool?).GetProperty("Value");
var quantityIsNull = ((Expression<Func<Product, bool>>)(x => x.QuantityPerUnit == null));
var nameIsNull = ((Expression<Func<Product, bool>>)(x => x.Name == null));
var quantityContains23 = ((Expression<Func<Product, bool?>>)(x => x.QuantityPerUnit.Contains("box")));
var nameContains2 = ((Expression<Func<Product, bool?>>)(x => x.Name.Contains("cha")));
var conjunction = Expression.AndAlso(Expression.Condition(quantityIsNull.Body, nullAsNullableBool, quantityContains23.Body),
Expression.Condition(nameIsNull.Body, nullAsNullableBool, nameContains2.Body));
var condition = Expression.Condition(Expression.Equal(conjunction, Expression.Constant(null)),
Expression.Constant(false),
Expression.MakeMemberAccess(conjunction, valueProperty));
var expr = Expression.Lambda<Func<Product, bool>>(condition, quantityIsNull.Parameters);
var results = db.Products.Where(expr).ToList();
Assert.That(results, Has.Count.EqualTo(1));
}
[Test(Description = "NH-3261")] |
<<<<<<<
using NHibernate.Util;
=======
using Remotion.Linq.Clauses.Expressions;
>>>>>>>
using NHibernate.Util;
using Remotion.Linq.Clauses.Expressions; |
<<<<<<<
public override bool SupportsAggregateInSubSelect => true;
/// <inheritdoc />
public override bool SupportsRowValueConstructorSyntax => true;
=======
/// <summary>
/// Npgsql does not clone the transaction in its context, and uses it in its prepare phase. When that was a
/// dependent transaction, it is then usually already disposed of, causing Npgsql to crash.
/// </summary>
public override bool SupportsDependentTransaction => false;
>>>>>>>
/// <summary>
/// Npgsql does not clone the transaction in its context, and uses it in its prepare phase. When that was a
/// dependent transaction, it is then usually already disposed of, causing Npgsql to crash.
/// </summary>
public override bool SupportsDependentTransaction => false;
public override bool SupportsAggregateInSubSelect => true;
/// <inheritdoc />
public override bool SupportsRowValueConstructorSyntax => true; |
<<<<<<<
=======
>>>>>>>
<<<<<<<
private const int MaxDevicesToDisplayOnDashboard = 200;
=======
>>>>>>>
private const int MaxDevicesToDisplayOnDashboard = 200;
<<<<<<<
private readonly IDeviceLogic _deviceLogic;
private readonly IConfigurationProvider _configProvider;
=======
>>>>>>>
private readonly IDeviceLogic _deviceLogic;
private readonly IConfigurationProvider _configProvider;
<<<<<<<
[HttpGet]
[Route("deviceLocationData")]
[WebApiRequirePermission(Permission.ViewTelemetry)]
public async Task<HttpResponseMessage> GetDeviceLocationData()
{
return await GetServiceResponseAsync<DeviceListLocationsModel>(async () =>
{
DeviceListQuery query = new DeviceListQuery()
{
Skip = 0,
Take = MaxDevicesToDisplayOnDashboard,
SortColumn = "DeviceID"
};
DeviceListQueryResult queryResult = await _deviceLogic.GetDevices(query);
DeviceListLocationsModel dataModel = _deviceLogic.ExtractLocationsData(queryResult.Results);
return dataModel;
}, false);
}
[HttpGet]
[Route("mapApiKey")]
[WebApiRequirePermission(Permission.ViewTelemetry)]
public async Task<HttpResponseMessage> GetMapApiKey()
{
return await GetServiceResponseAsync<string>(async () =>
{
String keySetting = await Task.Run(() =>
{
return _configProvider.GetConfigurationSettingValue("MapApiQueryKey");
});
return keySetting;
}, false);
}
=======
>>>>>>> |
<<<<<<<
=======
using System.Configuration;
>>>>>>>
using System.Configuration; |
<<<<<<<
#region Constants
private const int MaxDevicesToDisplayOnDashboard = 200;
private const double CautionAlertMaxMinutes = 91.0;
private const double CriticalAlertMaxMinutes = 11.0;
=======
>>>>>>>
private const int MaxDevicesToDisplayOnDashboard = 200;
private const double CautionAlertMaxMinutes = 91.0;
private const double CriticalAlertMaxMinutes = 11.0;
<<<<<<<
telemetryModels =
=======
IEnumerable<DeviceTelemetryModel> telemetryModels =
>>>>>>>
IEnumerable<DeviceTelemetryModel> telemetryModels =
<<<<<<<
#endregion
#endregion
#region Private Methods
private async Task<List<dynamic>> LoadAllDevicesAsync()
{
string deviceId;
DeviceListQuery query;
DeviceListQueryResult queryResult;
query = new DeviceListQuery()
{
Skip = 0,
Take = MaxDevicesToDisplayOnDashboard,
SortColumn = "DeviceID"
};
List<dynamic> devices = new List<dynamic>();
queryResult = await _deviceLogic.GetDevices(query);
if ((queryResult != null) &&
(queryResult.Results != null))
{
string enabledState = "";
dynamic props = null;
foreach (dynamic devInfo in queryResult.Results)
{
try
{
deviceId = DeviceSchemaHelper.GetDeviceID(devInfo);
props = DeviceSchemaHelper.GetDeviceProperties(devInfo);
enabledState = props.HubEnabledState;
}
catch (DeviceRequiredPropertyNotFoundException)
{
continue;
}
if (!string.IsNullOrWhiteSpace(deviceId))
{
devices.Add(devInfo);
}
}
}
return devices;
}
#endregion
=======
>>>>>>>
#region Private Methods
private async Task<List<dynamic>> LoadAllDevicesAsync()
{
string deviceId;
DeviceListQuery query;
DeviceListQueryResult queryResult;
query = new DeviceListQuery()
{
Skip = 0,
Take = MaxDevicesToDisplayOnDashboard,
SortColumn = "DeviceID"
};
List<dynamic> devices = new List<dynamic>();
queryResult = await _deviceLogic.GetDevices(query);
if ((queryResult != null) &&
(queryResult.Results != null))
{
string enabledState = "";
dynamic props = null;
foreach (dynamic devInfo in queryResult.Results)
{
try
{
deviceId = DeviceSchemaHelper.GetDeviceID(devInfo);
props = DeviceSchemaHelper.GetDeviceProperties(devInfo);
enabledState = props.HubEnabledState;
}
catch (DeviceRequiredPropertyNotFoundException)
{
continue;
}
if (!string.IsNullOrWhiteSpace(deviceId))
{
devices.Add(devInfo);
}
}
}
return devices;
}
#endregion |
<<<<<<<
await ConfigureServiceSource(Config);
await CreateLoadBalancer().GetNode();
=======
ConfigureServiceSource(Config);
await CreateLoadBalancer().TryGetNode();
>>>>>>>
await ConfigureServiceSource(Config);
await CreateLoadBalancer().TryGetNode();
<<<<<<<
await ConfigureServiceSource(Local);
await CreateLoadBalancer().GetNode();
=======
ConfigureServiceSource(Local);
await CreateLoadBalancer().TryGetNode();
>>>>>>>
await ConfigureServiceSource(Local);
await CreateLoadBalancer().TryGetNode(); |
<<<<<<<
OnStopWaitTimeMS = TryParseInt(ParseStringArg(nameof(OnStopWaitTimeMS), args));
=======
ProcessorAffinity = ParseProcessorIds(ParseStringArg(nameof(ProcessorAffinity), args));
>>>>>>>
OnStopWaitTimeMS = TryParseInt(ParseStringArg(nameof(OnStopWaitTimeMS), args));
ProcessorAffinity = ParseProcessorIds(ParseStringArg(nameof(ProcessorAffinity), args)); |
<<<<<<<
/// <summary>Find all mods in the given folder.</summary>
/// <param name="rootPath">The root mod path to search.</param>
/// <param name="jsonHelper">The JSON helper with which to read the manifest file.</param>
/// <param name="deprecationWarnings">A list to populate with any deprecation warnings.</param>
private ModMetadata[] FindMods(string rootPath, JsonHelper jsonHelper, IList<Action> deprecationWarnings)
{
this.Monitor.Log("Finding mods...");
void LogSkip(string displayName, string reasonPhrase, LogLevel level = LogLevel.Error) => this.Monitor.Log($"Skipped {displayName} because {reasonPhrase}", level);
// load mod metadata
List<ModMetadata> mods = new List<ModMetadata>();
foreach (string modRootPath in Directory.GetDirectories(rootPath))
{
if (this.Monitor.IsExiting)
return new ModMetadata[0]; // exit in progress
// init metadata
string displayName = modRootPath.Replace(rootPath, "").Trim('/', '\\');
// passthrough empty directories
DirectoryInfo directory = new DirectoryInfo(modRootPath);
while (!directory.GetFiles().Any() && directory.GetDirectories().Length == 1)
directory = directory.GetDirectories().First();
// get manifest path
string manifestPath = Path.Combine(directory.FullName, "manifest.json");
if (!File.Exists(manifestPath))
{
LogSkip(displayName, "it doesn't have a manifest.", LogLevel.Warn);
continue;
}
// read manifest
Manifest manifest;
try
{
// read manifest file
string json = File.ReadAllText(manifestPath);
if (string.IsNullOrEmpty(json))
{
LogSkip(displayName, "its manifest is empty.");
continue;
}
// parse manifest
manifest = jsonHelper.ReadJsonFile<Manifest>(Path.Combine(directory.FullName, "manifest.json"));
if (manifest == null)
{
LogSkip(displayName, "its manifest is invalid.");
continue;
}
// validate manifest
if (string.IsNullOrWhiteSpace(manifest.EntryDll))
{
LogSkip(displayName, "its manifest doesn't set an entry DLL.");
continue;
}
// log warnings for missing fields that will be required in SMAPI 2.0
{
List<string> missingFields = new List<string>(3);
if (string.IsNullOrWhiteSpace(manifest.Name))
missingFields.Add(nameof(IManifest.Name));
if (manifest.Version.ToString() == "0.0")
missingFields.Add(nameof(IManifest.Version));
if (string.IsNullOrWhiteSpace(manifest.UniqueID))
missingFields.Add(nameof(IManifest.UniqueID));
if (missingFields.Any())
deprecationWarnings.Add(() => this.Monitor.Log($"{manifest.Name} is missing some manifest fields ({string.Join(", ", missingFields)}) which will be required in an upcoming SMAPI version.", LogLevel.Warn));
}
}
catch (Exception ex)
{
LogSkip(displayName, $"parsing its manifest failed:\n{ex.GetLogSummary()}");
continue;
}
if (!string.IsNullOrWhiteSpace(manifest.Name))
displayName = manifest.Name;
// validate compatibility
ModCompatibility compatibility = this.ModRegistry.GetCompatibilityRecord(manifest);
if (compatibility?.Compatibility == ModCompatibilityType.AssumeBroken)
{
bool hasOfficialUrl = !string.IsNullOrWhiteSpace(compatibility.UpdateUrl);
bool hasUnofficialUrl = !string.IsNullOrWhiteSpace(compatibility.UnofficialUpdateUrl);
string reasonPhrase = compatibility.ReasonPhrase ?? "it's not compatible with the latest version of the game";
string error = $"{reasonPhrase}. Please check for a version newer than {compatibility.UpperVersionLabel ?? compatibility.UpperVersion} here:";
if (hasOfficialUrl)
error += !hasUnofficialUrl ? $" {compatibility.UpdateUrl}" : $"{Environment.NewLine}- official mod: {compatibility.UpdateUrl}";
if (hasUnofficialUrl)
error += $"{Environment.NewLine}- unofficial update: {compatibility.UnofficialUpdateUrl}";
LogSkip(displayName, error);
}
// validate SMAPI version
if (!string.IsNullOrWhiteSpace(manifest.MinimumApiVersion))
{
try
{
ISemanticVersion minVersion = new SemanticVersion(manifest.MinimumApiVersion);
if (minVersion.IsNewerThan(Constants.ApiVersion))
{
LogSkip(displayName, $"it needs SMAPI {minVersion} or later. Please update SMAPI to the latest version to use this mod.");
continue;
}
}
catch (FormatException ex) when (ex.Message.Contains("not a valid semantic version"))
{
LogSkip(displayName, $"it has an invalid minimum SMAPI version '{manifest.MinimumApiVersion}'. This should be a semantic version number like {Constants.ApiVersion}.");
continue;
}
}
// create per-save directory
if (manifest.PerSaveConfigs)
{
deprecationWarnings.Add(() => this.DeprecationManager.Warn(manifest.Name, $"{nameof(Manifest)}.{nameof(Manifest.PerSaveConfigs)}", "1.0", DeprecationLevel.Info));
try
{
string psDir = Path.Combine(directory.FullName, "psconfigs");
Directory.CreateDirectory(psDir);
if (!Directory.Exists(psDir))
{
LogSkip(displayName, "it requires per-save configuration files ('psconfigs') which couldn't be created for some reason.");
continue;
}
}
catch (Exception ex)
{
LogSkip(displayName, $"it requires per-save configuration files ('psconfigs') which couldn't be created: {ex.GetLogSummary()}");
continue;
}
}
// validate DLL path
string assemblyPath = Path.Combine(directory.FullName, manifest.EntryDll);
if (!File.Exists(assemblyPath))
{
LogSkip(displayName, $"its DLL '{manifest.EntryDll}' doesn't exist.");
continue;
}
// add mod metadata
mods.Add(new ModMetadata(displayName, directory.FullName, manifest, compatibility));
}
return mods.ToArray();
}
=======
>>>>>>> |
<<<<<<<
using Feature.FormsExtensions.Fields.Bindings;
using Sitecore;
=======
using System;
using Feature.FormsExtensions.Fields.Bindings;
>>>>>>>
using System;
using Feature.FormsExtensions.Fields.Bindings;
using Sitecore; |
<<<<<<<
[Imported(ObeysTypeSystem = true)]
public struct UInt32 {
=======
[Imported(IsRealType = true)]
public struct UInt32 : IHashable<UInt32> {
>>>>>>>
[Imported(ObeysTypeSystem = true)]
public struct UInt32 : IHashable<UInt32> { |
<<<<<<<
new PersistentConnection(configuration, connectionFactory, new EventBus()),
serializer,
=======
connectionFactory,
serializer,
>>>>>>>
new PersistentConnection(configuration, connectionFactory, new EventBus()),
serializer,
<<<<<<<
var message = (Error) serializer.BytesToMessage(typeof(Error), getArgs.Body);
=======
var message = (Error)serializer.BytesToMessage(typeof(Error), getArgs.Body.ToArray());
>>>>>>>
var message = (Error) serializer.BytesToMessage(typeof(Error), getArgs.Body.ToArray()); |
<<<<<<<
var publishExchangeDeclareStrategy = new VersionedPublishExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
try
{
publishExchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
}
catch (Exception)
{
}
=======
var exchangeDeclareStrategy = new DefaultExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
var declaredExchange = exchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
>>>>>>>
var exchangeDeclareStrategy = new VersionedExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
try
{
exchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
}
catch (Exception)
{
}
var declaredExchange = exchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
advancedBus.Received(2).ExchangeDeclareAsync(exchangeName, Arg.Any<Action<IExchangeDeclareConfiguration>>());
declaredExchange.Should().BeSameAs(exchange);
exchangeDeclareCount.Should().Be(1);
}
[Fact]
public void Should_declare_exchange_the_first_time_declare_is_called()
{
var exchangeDeclareCount = 0;
var advancedBus = Substitute.For<IAdvancedBus>();
IExchange exchange = new Exchange(exchangeName);
advancedBus.ExchangeDeclareAsync(exchangeName, Arg.Any<Action<IExchangeDeclareConfiguration>>())
.Returns(x =>
{
exchangeDeclareCount++;
return Task.FromResult(exchange);
});
var publishExchangeDeclareStrategy = new DefaultExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
<<<<<<<
var publishExchangeDeclareStrategy = new PublishExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
var declaredExchange = publishExchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
=======
var exchangeDeclareStrategy = new DefaultExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
var _ = exchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
var declaredExchange = exchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic);
>>>>>>>
var publishExchangeDeclareStrategy = new DefaultExchangeDeclareStrategy(Substitute.For<IConventions>(), advancedBus);
var declaredExchange = publishExchangeDeclareStrategy.DeclareExchange(exchangeName, ExchangeType.Topic); |
<<<<<<<
public async Task FuturePublishAsync<T>(T message, TimeSpan delay, string topic = null, CancellationToken cancellationToken = default)
=======
public Task FuturePublishAsync<T>(DateTime futurePublishDate, T message, string cancellationKey = null) where T : class
{
return FuturePublishAsync(futurePublishDate, message, "#", cancellationKey);
}
public Task FuturePublishAsync<T>(DateTime futurePublishDate, T message, string topic, string cancellationKey = null) where T : class
{
return FuturePublishInternalAsync(futurePublishDate - DateTime.UtcNow, message, topic, cancellationKey);
}
public void FuturePublish<T>(DateTime futurePublishDate, T message, string cancellationKey = null) where T : class
{
FuturePublish(futurePublishDate, message, "#", cancellationKey);
}
public void FuturePublish<T>(DateTime futurePublishDate, T message, string topic, string cancellationKey = null) where T : class
{
FuturePublishInternal(futurePublishDate - DateTime.UtcNow, message, topic, cancellationKey);
}
public Task FuturePublishAsync<T>(TimeSpan messageDelay, T message, string cancellationKey = null) where T : class
{
return FuturePublishAsync(messageDelay, message, "#", cancellationKey);
}
public Task FuturePublishAsync<T>(TimeSpan messageDelay, T message, string topic, string cancellationKey = null) where T : class
{
return FuturePublishInternalAsync(messageDelay, message, topic, cancellationKey);
}
public void FuturePublish<T>(TimeSpan messageDelay, T message, string cancellationKey = null) where T : class
{
FuturePublish(messageDelay, message, "#", cancellationKey);
}
public void FuturePublish<T>(TimeSpan messageDelay, T message, string topic, string cancellationKey = null) where T : class
{
FuturePublishInternal(messageDelay, message, topic, cancellationKey);
}
public Task CancelFuturePublishAsync(string cancellationKey)
{
throw new NotImplementedException("Cancellation is not supported");
}
public void CancelFuturePublish(string cancellationKey)
{
throw new NotImplementedException("Cancellation is not supported");
}
private async Task FuturePublishInternalAsync<T>(TimeSpan messageDelay, T message, string topic, string cancellationKey = null) where T : class
{
Preconditions.CheckNotNull(message, "message");
Preconditions.CheckLess(messageDelay, MaxMessageDelay, "messageDelay");
Preconditions.CheckNull(cancellationKey, "cancellationKey");
var exchangeName = conventions.ExchangeNamingConvention(typeof (T));
var futureExchangeName = exchangeName + "_delayed";
var futureExchange = await advancedBus.ExchangeDeclareAsync(futureExchangeName, ExchangeType.Direct, delayed: true).ConfigureAwait(false);
var exchange = await advancedBus.ExchangeDeclareAsync(exchangeName, ExchangeType.Topic).ConfigureAwait(false);
await advancedBus.BindAsync(futureExchange, exchange, topic).ConfigureAwait(false);
var easyNetQMessage = new Message<T>(message)
{
Properties =
{
DeliveryMode = messageDeliveryModeStrategy.GetDeliveryMode(typeof (T)),
Headers = new Dictionary<string, object> {{"x-delay", (int) messageDelay.TotalMilliseconds}}
}
};
await advancedBus.PublishAsync(futureExchange, topic, false, easyNetQMessage).ConfigureAwait(false);
}
private void FuturePublishInternal<T>(TimeSpan messageDelay, T message, string topic, string cancellationKey = null) where T : class
>>>>>>>
public async Task FuturePublishAsync<T>(T message, TimeSpan delay, string topic = null, CancellationToken cancellationToken = default)
<<<<<<<
var queueName = conventions.QueueNamingConvention(typeof(T), null);
var futureExchange = await advancedBus.ExchangeDeclareAsync(
futureExchangeName,
c => c.AsDelayedExchange(ExchangeType.Direct),
cancellationToken
).ConfigureAwait(false);
var exchange = await advancedBus.ExchangeDeclareAsync(
exchangeName,
c => c.WithType(ExchangeType.Topic),
cancellationToken
).ConfigureAwait(false);
await advancedBus.BindAsync(futureExchange, exchange, topic, cancellationToken).ConfigureAwait(false);
var queue = await advancedBus.QueueDeclareAsync(queueName, cancellationToken).ConfigureAwait(false);
await advancedBus.BindAsync(exchange, queue, topic, cancellationToken).ConfigureAwait(false);
=======
var futureExchange = advancedBus.ExchangeDeclare(futureExchangeName, ExchangeType.Direct, delayed: true);
var exchange = advancedBus.ExchangeDeclare(exchangeName, ExchangeType.Topic);
advancedBus.Bind(futureExchange, exchange, topic);
>>>>>>>
var futureExchange = await advancedBus.ExchangeDeclareAsync(
futureExchangeName,
c => c.AsDelayedExchange(ExchangeType.Direct),
cancellationToken
).ConfigureAwait(false);
var exchange = await advancedBus.ExchangeDeclareAsync(
exchangeName,
c => c.WithType(ExchangeType.Topic),
cancellationToken
).ConfigureAwait(false);
await advancedBus.BindAsync(futureExchange, exchange, topic, cancellationToken).ConfigureAwait(false); |
<<<<<<<
using System.Threading;
#if NETFX
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
#endif
=======
>>>>>>>
using System.Threading; |
<<<<<<<
[assembly: AssemblyVersion("0.48.0.0")]
=======
[assembly: AssemblyVersion("0.47.10.0")]
>>>>>>>
[assembly: AssemblyVersion("0.48.0.0")]
<<<<<<<
// 0.48.0.0 Updated to RabbitMQ.Client 3.5
=======
// 0.47.10.0 RabbitHutch.CreateBus overloads
// 0.47.9.0 TypeNameSerializer now uses a ConcurrentDictionary to store se/deserialization results.
>>>>>>>
// 0.48.0.0 Updated to RabbitMQ.Client 3.5
// 0.47.10.0 RabbitHutch.CreateBus overloads
// 0.47.9.0 TypeNameSerializer now uses a ConcurrentDictionary to store se/deserialization results. |
<<<<<<<
private readonly AdvancedBusEventHandlers advancedBusEventHandlers;
=======
private readonly IConventions conventions;
>>>>>>>
private readonly IConventions conventions;
private readonly AdvancedBusEventHandlers advancedBusEventHandlers;
<<<<<<<
IMessageSerializationStrategy messageSerializationStrategy,
AdvancedBusEventHandlers advancedBusEventHandlers)
=======
IMessageSerializationStrategy messageSerializationStrategy,
IConventions conventions)
>>>>>>>
IMessageSerializationStrategy messageSerializationStrategy,
IConventions conventions,
AdvancedBusEventHandlers advancedBusEventHandlers)
<<<<<<<
Preconditions.CheckNotNull(advancedBusEventHandlers, "advancedBusEventHandlers");
=======
Preconditions.CheckNotNull(conventions, "conventions");
>>>>>>>
Preconditions.CheckNotNull(conventions, "conventions");
Preconditions.CheckNotNull(advancedBusEventHandlers, "advancedBusEventHandlers");
<<<<<<<
this.advancedBusEventHandlers = advancedBusEventHandlers;
=======
this.conventions = conventions;
>>>>>>>
this.conventions = conventions;
this.advancedBusEventHandlers = advancedBusEventHandlers; |
<<<<<<<
// Note: until version 1.0 expect breaking changes on 0.X versions.
[assembly: AssemblyVersion("0.64.2.0")]
=======
>>>>>>>
<<<<<<<
// Note: until version 1.0 expect breaking changes on 0.X versions.
// 0.64.2.0 Add durability queue on subscription
// 0.64.1.0 Hosepipe custom broker port configuration by separate parameter
// 0.64.0.0 Added RabbitMQ broker custom port support to hosepipe
=======
// 1.0.0.0
// 0.63.7.0 Fix Client Command Dispatcher Thread hijacking
// 0.63.6.0 Added support for multiple exchange (creating an exchange per implemented interface for a concreate type)
// 0.63.5.0 Made some methods protected/virtual in HandlerRunner so we can override the behavior
// 0.63.4.0 EasyNetQ.Scheduler stability fixes
// 0.63.3.0 Allow injection of custom implementation of IPersistentConnection
// 0.63.2.0 Make SimpleInjectorMessageDispatcher public so it can be used with AutoSubscriber
// 0.63.1.0 Set upper bound of supported rabbitmq client version
>>>>>>>
// 1.0.0.0
// 0.64.2.0 Add durability queue on subscription
// 0.64.1.0 Hosepipe custom broker port configuration by separate parameter
// 0.64.0.0 Added RabbitMQ broker custom port support to hosepipe
// 0.63.4.0 EasyNetQ.Scheduler stability fixes
// 0.63.3.0 Allow injection of custom implementation of IPersistentConnection
// 0.63.2.0 Make SimpleInjectorMessageDispatcher public so it can be used with AutoSubscriber
// 0.63.1.0 Set upper bound of supported rabbitmq client version |
<<<<<<<
await bus.PubSub.PublishBatchAsync(messages, timeoutCts.Token).ConfigureAwait(false);
=======
await bus.PublishBatchAsync(messages, cts.Token).ConfigureAwait(false);
>>>>>>>
await bus.PubSub.PublishBatchAsync(messages, cts.Token).ConfigureAwait(false); |
<<<<<<<
await bus.Scheduler.FuturePublishBatchAsync(messages, TimeSpan.FromSeconds(5), cts.Token)
=======
await bus.FuturePublishBatchAsync(messages, TimeSpan.FromSeconds(5), "#", cts.Token)
>>>>>>>
await bus.Scheduler.FuturePublishBatchAsync(messages, TimeSpan.FromSeconds(5), "#", cts.Token) |
<<<<<<<
public struct SerializedProgram : IAssetReadable
{
public void Read(AssetReader reader)
{
m_subPrograms = reader.ReadArray<SerializedSubProgram>();
}
Dictionary<ShaderGpuProgramType, int> GetIsTierLookup(IReadOnlyList<SerializedSubProgram> subPrograms)
{
var lookup = new Dictionary<ShaderGpuProgramType, int>();
var seen = new Dictionary<ShaderGpuProgramType, byte>();
foreach (var subProgram in subPrograms)
{
if (seen.ContainsKey(subProgram.GpuProgramType))
{
if (seen[subProgram.GpuProgramType] != subProgram.ShaderHardwareTier)
{
lookup[subProgram.GpuProgramType] = 2;
}
}
else
{
seen[subProgram.GpuProgramType] = subProgram.ShaderHardwareTier;
lookup[subProgram.GpuProgramType] = 1;
}
}
return lookup;
}
public void Export(ShaderWriter writer, ShaderType type)
{
if(SubPrograms.Count > 0)
{
writer.WriteIntent(3);
writer.Write("Program \"{0}\" {{\n", type.ToProgramTypeString());
var isTierLookup = GetIsTierLookup(SubPrograms);
foreach (SerializedSubProgram subProgram in SubPrograms)
{
Platform uplatform = writer.Platform;
GPUPlatform platform = subProgram.GpuProgramType.ToGPUPlatform(uplatform);
int index = writer.Shader.Platforms.IndexOf(platform);
ShaderSubProgramBlob blob = writer.Shader.SubProgramBlobs[index];
int count = isTierLookup[subProgram.GpuProgramType];
subProgram.Export(writer, blob, count > 1);
}
writer.WriteIntent(3);
writer.Write("}\n");
}
}
=======
public struct SerializedProgram : IAssetReadable
{
public void Read(AssetReader reader)
{
m_subPrograms = reader.ReadAssetArray<SerializedSubProgram>();
}
>>>>>>>
public struct SerializedProgram : IAssetReadable
{
public void Read(AssetReader reader)
{
m_subPrograms = reader.ReadAssetArray<SerializedSubProgram>();
}
Dictionary<ShaderGpuProgramType, int> GetIsTierLookup(IReadOnlyList<SerializedSubProgram> subPrograms)
{
var lookup = new Dictionary<ShaderGpuProgramType, int>();
var seen = new Dictionary<ShaderGpuProgramType, byte>();
foreach (var subProgram in subPrograms)
{
if (seen.ContainsKey(subProgram.GpuProgramType))
{
if (seen[subProgram.GpuProgramType] != subProgram.ShaderHardwareTier)
{
lookup[subProgram.GpuProgramType] = 2;
}
}
else
{
seen[subProgram.GpuProgramType] = subProgram.ShaderHardwareTier;
lookup[subProgram.GpuProgramType] = 1;
}
}
return lookup;
}
public void Export(ShaderWriter writer, ShaderType type)
{
if(SubPrograms.Count > 0)
{
writer.WriteIntent(3);
writer.Write("Program \"{0}\" {{\n", type.ToProgramTypeString());
var isTierLookup = GetIsTierLookup(SubPrograms);
foreach (SerializedSubProgram subProgram in SubPrograms)
{
Platform uplatform = writer.Platform;
GPUPlatform platform = subProgram.GpuProgramType.ToGPUPlatform(uplatform);
int index = writer.Shader.Platforms.IndexOf(platform);
ShaderSubProgramBlob blob = writer.Shader.SubProgramBlobs[index];
int count = isTierLookup[subProgram.GpuProgramType];
subProgram.Export(writer, blob, count > 1);
}
writer.WriteIntent(3);
writer.Write("}\n");
}
} |
<<<<<<<
private MD5 md5 = MD5.Create();
public IEnumerable<byte[]> Execute(int split, IEnumerable<KeyValuePair<K1, V1>> input)
=======
private static MD5 md5 = MD5.Create();
private readonly int numPartitions;
private readonly Func<dynamic, int> partitionFunc = null;
public AddShuffleKeyHelper(int numPartitions, Func<dynamic, int> partitionFunc = null)
{
this.numPartitions = numPartitions;
this.partitionFunc = partitionFunc;
}
public IEnumerable<byte[]> Execute(int split, IEnumerable<KeyValuePair<K, V>> input)
>>>>>>>
private MD5 md5 = MD5.Create();
private readonly int numPartitions;
private readonly Func<dynamic, int> partitionFunc = null;
public AddShuffleKeyHelper(int numPartitions, Func<dynamic, int> partitionFunc = null)
{
this.numPartitions = numPartitions;
this.partitionFunc = partitionFunc;
}
public IEnumerable<byte[]> Execute(int split, IEnumerable<KeyValuePair<K, V>> input) |
<<<<<<<
Func<double, RDD<dynamic>, RDD<dynamic>, RDD<dynamic>> func = new UpdateStateByKeysHelper<K, V, S>(updateFunc, prevFunc, initialState, numPartitions).Execute;
=======
Func<double, RDD<dynamic>, RDD<dynamic>, RDD<dynamic>> func = new UpdateStateByKeysHelper<K, V, S>(updateFunc, numPartitions).Execute;
>>>>>>>
Func<double, RDD<dynamic>, RDD<dynamic>, RDD<dynamic>> func = new UpdateStateByKeysHelper<K, V, S>(updateFunc, initialState, numPartitions).Execute;
<<<<<<<
private readonly Func<double, RDD<dynamic>, RDD<dynamic>> prevFunc;
private readonly RDD<KeyValuePair<K, S>> initialState;
=======
>>>>>>>
private readonly RDD<KeyValuePair<K, S>> initialState; |
<<<<<<<
IDataFrameReaderProxy Read();
=======
IDataFrameProxy CreateDataFrame(IRDDProxy rddProxy, IStructTypeProxy structTypeProxy);
>>>>>>>
IDataFrameReaderProxy Read();
IDataFrameProxy CreateDataFrame(IRDDProxy rddProxy, IStructTypeProxy structTypeProxy); |
<<<<<<<
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier)
.Accepts(AcceptedCharactersInternal.NonWhiteSpace)
.With(new DirectiveTokenChunkGenerator(CSharpCodeParser.SectionDirectiveDescriptor.Tokens.First())),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
=======
Factory.MetaCode("section").Accepts(AcceptedCharacters.None),
Factory.Span(SpanKind.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.WhiteSpace),
Factory.Span(SpanKind.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKind.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharacters.None),
>>>>>>>
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
<<<<<<<
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier)
.Accepts(AcceptedCharactersInternal.NonWhiteSpace)
.With(new DirectiveTokenChunkGenerator(CSharpCodeParser.SectionDirectiveDescriptor.Tokens.First())),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
=======
Factory.MetaCode("section").Accepts(AcceptedCharacters.None),
Factory.Span(SpanKind.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.WhiteSpace),
Factory.Span(SpanKind.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKind.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharacters.None),
>>>>>>>
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None), |
<<<<<<<
private void GenerateExtraBoonData(ParsedLog log, long boonid, Point[] accurateUptime, List<PhaseData> phases)
=======
private void generateExtraBoonData(ParsedLog log, long boonid, BoonSimulationResult boonSimulation, List<PhaseData> phases)
>>>>>>>
private void generateExtraBoonData(ParsedLog log, long boonid, BoonSimulationResult boonSimulation, List<PhaseData> phases)
<<<<<<<
List<DamageLog> dmLogs = GetJustPlayerDamageLogs(0, log, phases[i].GetStart(), phases[i].GetEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.GetDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).Sum(x => x.GetDamage()), 1);
List<DamageLog> effect = dmLogs.Where(x => accurateUptime[(int)x.GetTime()].Y > 0 && x.IsCondi() == 0).ToList();
List<DamageLog> effectBoss = effect.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).ToList();
int damage = (int)(effect.Sum(x => x.GetDamage()) / 21.0);
int bossDamage = (int)(effectBoss.Sum(x => x.GetDamage()) / 21.0);
=======
List<DamageLog> dmLogs = getJustPlayerDamageLogs(0, log, phases[i].getStart(), phases[i].getEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.getDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.getDstInstidt() == log.getBossData().getInstid()).Sum(x => x.getDamage()), 1);
List<DamageLog> effect = dmLogs.Where(x => boonSimulation.GetBoonStackCount((int)x.getTime()) > 0 && x.isCondi() == 0).ToList();
List<DamageLog> effectBoss = effect.Where(x => x.getDstInstidt() == log.getBossData().getInstid()).ToList();
int damage = (int)(effect.Sum(x => x.getDamage()) / 21.0);
int bossDamage = (int)(effectBoss.Sum(x => x.getDamage()) / 21.0);
>>>>>>>
List<DamageLog> dmLogs = GetJustPlayerDamageLogs(0, log, phases[i].GetStart(), phases[i].GetEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.GetDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).Sum(x => x.GetDamage()), 1);
List<DamageLog> effect = dmLogs.Where(x => boonSimulation.GetBoonStackCount((int)x.GetTime()) > 0 && x.IsCondi() == 0).ToList();
List<DamageLog> effectBoss = effect.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).ToList();
int damage = (int)(effect.Sum(x => x.GetDamage()) / 21.0);
int bossDamage = (int)(effectBoss.Sum(x => x.GetDamage()) / 21.0);
<<<<<<<
List<DamageLog> dmLogs = GetJustPlayerDamageLogs(0, log, phases[i].GetStart(), phases[i].GetEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.GetDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).Sum(x => x.GetDamage()), 1);
int effectCount = dmLogs.Count(x => accurateUptime[(int)x.GetTime()].Y > 0 && x.IsCondi() == 0);
int effectBossCount = dmLogs.Count(x => accurateUptime[(int)x.GetTime()].Y > 0 && x.IsCondi() == 0 && x.GetDstInstidt() == log.GetBossData().GetInstid());
=======
List<DamageLog> dmLogs = getJustPlayerDamageLogs(0, log, phases[i].getStart(), phases[i].getEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.getDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.getDstInstidt() == log.getBossData().getInstid()).Sum(x => x.getDamage()), 1);
int effectCount = dmLogs.Where(x => boonSimulation.GetBoonStackCount((int)x.getTime()) > 0 && x.isCondi() == 0).Count();
int effectBossCount = dmLogs.Where(x => boonSimulation.GetBoonStackCount((int)x.getTime()) > 0 && x.isCondi() == 0 && x.getDstInstidt() == log.getBossData().getInstid()).Count();
>>>>>>>
List<DamageLog> dmLogs = GetJustPlayerDamageLogs(0, log, phases[i].GetStart(), phases[i].GetEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.GetDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).Sum(x => x.GetDamage()), 1);
int effectCount = dmLogs.Count(x => boonSimulation.GetBoonStackCount((int)x.GetTime()) > 0 && x.IsCondi() == 0);
int effectBossCount = dmLogs.Count(x => boonSimulation.GetBoonStackCount((int)x.GetTime()) > 0 && x.IsCondi() == 0 && x.GetDstInstidt() == log.GetBossData().GetInstid());
<<<<<<<
List<DamageLog> dmLogs = GetJustPlayerDamageLogs(0, log, phases[i].GetStart(), phases[i].GetEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.GetDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).Sum(x => x.GetDamage()), 1);
List<DamageLog> effect = dmLogs.Where(x => accurateUptime[(int)x.GetTime()].Y > 0 && x.IsCondi() == 0).ToList();
List<DamageLog> effectBoss = effect.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).ToList();
int damage = (int)(effect.Sum(x => x.GetDamage()) / 11.0);
int bossDamage = (int)(effectBoss.Sum(x => x.GetDamage()) / 11.0);
=======
List<DamageLog> dmLogs = getJustPlayerDamageLogs(0, log, phases[i].getStart(), phases[i].getEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.getDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.getDstInstidt() == log.getBossData().getInstid()).Sum(x => x.getDamage()), 1);
List<DamageLog> effect = dmLogs.Where(x => boonSimulation.GetBoonStackCount((int)x.getTime()) > 0 && x.isCondi() == 0).ToList();
List<DamageLog> effectBoss = effect.Where(x => x.getDstInstidt() == log.getBossData().getInstid()).ToList();
int damage = (int)(effect.Sum(x => x.getDamage()) / 11.0);
int bossDamage = (int)(effectBoss.Sum(x => x.getDamage()) / 11.0);
>>>>>>>
List<DamageLog> dmLogs = GetJustPlayerDamageLogs(0, log, phases[i].GetStart(), phases[i].GetEnd());
int totalDamage = Math.Max(dmLogs.Sum(x => x.GetDamage()), 1);
int totalBossDamage = Math.Max(dmLogs.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).Sum(x => x.GetDamage()), 1);
List<DamageLog> effect = dmLogs.Where(x => boonSimulation.GetBoonStackCount((int)x.GetTime()) > 0 && x.IsCondi() == 0).ToList();
List<DamageLog> effectBoss = effect.Where(x => x.GetDstInstidt() == log.GetBossData().GetInstid()).ToList();
int damage = (int)(effect.Sum(x => x.GetDamage()) / 11.0);
int bossDamage = (int)(effectBoss.Sum(x => x.GetDamage()) / 11.0);
<<<<<<<
var toFill = new Point[dur + 1];
var toFillPresence = new Point[dur + 1];
long death = GetDeath(log, 0, dur) - log.GetBossData().GetFirstAware();
=======
long death = getDeath(log, 0, dur) - log.getBossData().getFirstAware();
>>>>>>>
long death = GetDeath(log, 0, dur) - log.GetBossData().GetFirstAware();
<<<<<<<
var simulation = simulator.GetSimulationResult();
var updateBoonPresence = Boon.GetBoonList().Any(x => x.GetID() == boonid);
var updateCondiPresence = boonid != 873 && Boon.GetCondiBoonList().Any(x => x.GetID() == boonid);
foreach (var simul in simulation)
=======
var simulation = simulator.getSimulationResult();
var updateBoonPresence = Boon.getBoonList().Any(x => x.getID() == boonid);
var updateCondiPresence = boonid != 873 && Boon.getCondiBoonList().Any(x => x.getID() == boonid);
foreach (var simul in simulation.Items)
>>>>>>>
var simulation = simulator.GetSimulationResult();
var updateBoonPresence = Boon.GetBoonList().Any(x => x.GetID() == boonid);
var updateCondiPresence = boonid != 873 && Boon.GetCondiBoonList().Any(x => x.GetID() == boonid);
foreach (var simul in simulation.Items)
<<<<<<<
Replay.AddBoon(boonid, toFill[time].Y);
=======
replay.addBoon(boonid, simulation.GetBoonStackCount(time));
>>>>>>>
Replay.AddBoon(boonid, simulation.GetBoonStackCount(time));
<<<<<<<
_boonPoints[boonid] = new BoonsGraphModel(boon.GetName(), reducedPrecision);
=======
boon_points[boonid] = new BoonsGraphModel(boon.getName(), graphPoints);
>>>>>>>
_boonPoints[boonid] = new BoonsGraphModel(boon.GetName(), graphPoints);
<<<<<<<
private void SetMinions(ParsedLog log)
=======
private void setMinions(ParsedLog log)
>>>>>>>
private void SetMinions(ParsedLog log) |
<<<<<<<
new Mechanic(31722, "Spirited Fusion", Mechanic.MechType.EnemyBoon, ParseEnum.BossIDS.Gorseval, "symbol:'square',color:'rgb(255,140,0)',", "SprtBf",0), // Spirited Fusion (Consumed a Spirit), Ate Spirit
new Mechanic(31720, "Kick", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Gorseval, "symbol:'triangle-right',color:'rgb(255,0,255)',", "Kick",0), // Kicked by small add, Spirit Kick
new Mechanic(738, "Ghastly Rampage", Mechanic.MechType.PlayerBoon, ParseEnum.BossIDS.Gorseval, "symbol:'circle',color:'rgb(0,0,0)',", "Black",3000,(value => value == 10000))// //stood in black? Trigger via (25 stacks) vuln (ID 738) application would be possible
=======
new Mechanic(31722, "Spirited Fusion", Mechanic.MechType.EnemyBoon, ParseEnum.BossIDS.Gorseval, "symbol:'square',color:'rgb(255,140,0)',", "SprtBf",100), // Spirited Fusion (Consumed a Spirit), Ate Spirit
new Mechanic(31720, "Kick", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Gorseval, "symbol:'triangle-right',color:'rgb(255,0,255)',", "Kick",0), // Kicked by small add, Spirit Kick
new Mechanic(738, "Ghastly Rampage", Mechanic.MechType.PlayerBoon, ParseEnum.BossIDS.Gorseval, "symbol:'circle',color:'rgb(0,0,0)',", "Black",3000,delegate(long value){return value == 10000;}) //stood in black? Trigger via (25 stacks) vuln (ID 738) application would be possible
>>>>>>>
new Mechanic(31722, "Spirited Fusion", Mechanic.MechType.EnemyBoon, ParseEnum.BossIDS.Gorseval, "symbol:'square',color:'rgb(255,140,0)',", "SprtBf",100), // Spirited Fusion (Consumed a Spirit), Ate Spirit
new Mechanic(31720, "Kick", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Gorseval, "symbol:'triangle-right',color:'rgb(255,0,255)',", "Kick",0), // Kicked by small add, Spirit Kick
new Mechanic(738, "Ghastly Rampage", Mechanic.MechType.PlayerBoon, ParseEnum.BossIDS.Gorseval, "symbol:'circle',color:'rgb(0,0,0)',", "Black",3000,(value => value == 10000))// //stood in black? Trigger via (25 stacks) vuln (ID 738) application would be possible |
<<<<<<<
IsCondi = dl.IsCondi,
ID = dl.SkillId,
=======
Condi = dl.IsIndirectDamage,
Skill = dl.SkillId,
>>>>>>>
IsCondi = dl.IsIndirectDamage,
ID = dl.SkillId,
<<<<<<<
IsCondi = dl.IsCondi,
ID = dl.SkillId,
=======
Condi = dl.IsIndirectDamage,
Skill = dl.SkillId,
>>>>>>>
IsCondi = dl.IsIndirectDamage,
ID = dl.SkillId,
<<<<<<<
IsCondi = dl.IsCondi,
ID = dl.SkillId,
=======
Condi = dl.IsIndirectDamage,
Skill = dl.SkillId,
>>>>>>>
IsCondi = dl.IsIndirectDamage,
ID = dl.SkillId, |
<<<<<<<
#if !DEBUG
[assembly: AssemblyVersion("2.7.1.0")]
=======
#if PROD
[assembly: AssemblyVersion("2.8.0.0")]
>>>>>>>
#if !DEBUG
[assembly: AssemblyVersion("2.8.0.0")] |
<<<<<<<
using Microsoft.AspNet.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting.Internal;
=======
>>>>>>>
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting.Internal; |
<<<<<<<
List<AbstractCastEvent> cls = mainTarget.GetCastEvents(log, 0, log.FightData.FightEnd);
=======
IReadOnlyList<AbstractCastEvent> cls = mainTarget.GetCastLogs(log, 0, log.FightData.FightEnd);
>>>>>>>
IReadOnlyList<AbstractCastEvent> cls = mainTarget.GetCastEvents(log, 0, log.FightData.FightEnd); |
<<<<<<<
CombatItem dead = log.CombatData.LastOrDefault(x => x.SrcInstid == AgentItem.InstID && x.IsStateChange.IsDead() && x.Time >= start + offset && x.Time <= end + offset);
=======
CombatItem dead = log.CombatData.GetStatesData(ParseEnum.StateChange.ChangeDead).LastOrDefault(x => x.SrcInstid == Agent.InstID && x.Time >= start + offset && x.Time <= end + offset);
>>>>>>>
CombatItem dead = log.CombatData.GetStatesData(ParseEnum.StateChange.ChangeDead).LastOrDefault(x => x.SrcInstid == InstID && x.Time >= start + offset && x.Time <= end + offset);
<<<<<<<
long agentStart = Math.Max(FirstAware - log.FightData.FightStart,0);
long agentEnd = Math.Min(LastAware - log.FightData.FightStart, log.FightData.FightDuration);
HashSet<long> tableIds = new HashSet<long> (boonIds);
tableIds.UnionWith(condiIds);
tableIds.UnionWith(offIds);
tableIds.UnionWith(defIds);
foreach(CombatItem c in log.GetBoonDataByDst(AgentItem.InstID))
=======
HashSet<long> OneCapacityIds = new HashSet<long> (Boon.BoonsByCapacity[1].Select(x => x.ID));
bool needCustomRemove = true;
foreach (CombatItem c in log.GetBoonDataByDst(Agent.InstID))
>>>>>>>
long agentStart = Math.Max(FirstAware - log.FightData.FightStart,0);
long agentEnd = Math.Min(LastAware - log.FightData.FightStart, log.FightData.FightDuration);
HashSet<long> OneCapacityIds = new HashSet<long> (Boon.BoonsByCapacity[1].Select(x => x.ID));
bool needCustomRemove = true;
foreach (CombatItem c in log.GetBoonDataByDst(InstID))
<<<<<<<
else if (Boon.RemovePermission(boonId, c.IsBuffRemove, c.IFF) && time < agentEnd - 50)
=======
else if (time < log.FightData.FightDuration - 50)
>>>>>>>
else if (time < log.FightData.FightDuration - 50)
<<<<<<<
HashSet<long> boonIds = new HashSet<long>(Boon.GetBoonList().Select(x => x.ID));
HashSet<long> condiIds = new HashSet<long>(Boon.GetCondiBoonList().Select(x => x.ID));
HashSet<long> defIds = new HashSet<long>(Boon.GetDefensiveTableList().Select(x => x.ID));
HashSet<long> offIds = new HashSet<long>(Boon.GetOffensiveTableList().Select(x => x.ID));
List<PhaseData> phases = log.FightData.GetPhases(log);
BoonMap toUse = GetBoonMap(log, boonIds, condiIds, defIds, offIds);
=======
List<PhaseData> phases = log.Boss.GetPhases(log);
BoonMap toUse = GetBoonMap(log);
>>>>>>>
List<PhaseData> phases = log.FightData.GetPhases(log);
BoonMap toUse = GetBoonMap(log); |
<<<<<<<
string name = pair.Key.TrimEnd(" \0".ToArray());
playerDto.minions.Add(new MinionDto(pair.Value.MinionID, name));
=======
playerDto.minions.Add(new MinionDto(pair.Value.InstID, pair.Key.TrimEnd(" \0".ToArray())));
>>>>>>>
playerDto.minions.Add(new MinionDto(pair.Value.MinionID, pair.Key.TrimEnd(" \0".ToArray()))); |
<<<<<<<
=======
>>>>>>>
<<<<<<<
Dictionary<string, List<Statistics.ExtraBoonData>> toCheck = p.GetExtraBoonData(_log, null);
dmgCommonModifiersBuffs.UnionWith(toCheck.Keys.Select(x => Boon.BoonsByName[x].ID));
}*/
=======
Dictionary<long, List<Statistics.DamageModifierData>> toCheck = p.GetDamageModifierData(_log, null);
dmgCommonModifiersBuffs.UnionWith(toCheck.Keys);
}
>>>>>>>
Dictionary<string, List<Statistics.ExtraBoonData>> toCheck = p.GetExtraBoonData(_log, null);
dmgCommonModifiersBuffs.UnionWith(toCheck.Keys.Select(x => Boon.BoonsByName[x].ID));
}*/ |
<<<<<<<
boss.AvgBoons = _statistics.AvgTargetBoons[target];
boss.AvgConditions = _statistics.AvgTargetConditions[target];
boss.Dps = BuildDPS(_statistics.TargetDps[target]);
boss.Buffs = BuildBossBuffs(_statistics.TargetConditions[target], target);
boss.HitboxHeight = target.HitboxHeight;
boss.HitboxWidth = target.HitboxWidth;
boss.Dps1s = Build1SDPS(target, null);
boss.Rotation = BuildRotation(target.GetCastLogs(_log, 0, _log.FightData.FightDuration));
boss.FirstAware = (int)(target.FirstAware - _log.FightData.FightStart);
boss.LastAware = (int)(target.LastAware - _log.FightData.FightStart);
boss.Minions = BuildMinions(target);
boss.TotalDamageDist = BuildDamageDist(target, null);
boss.AvgBoonsStates = BuildBuffStates(target.GetBoonGraphs(_log)[-2]);
boss.AvgConditionsStates = BuildBuffStates(target.GetBoonGraphs(_log)[-3]);
=======
>>>>>>> |
<<<<<<<
public List<int> Get1SDamageList(ParsedEvtcLog log, long start, long end, AbstractActor target)
=======
public IReadOnlyList<int> Get1SDamageList(ParsedEvtcLog log, int phaseIndex, PhaseData phase, AbstractActor target)
>>>>>>>
public IReadOnlyList<int> Get1SDamageList(ParsedEvtcLog log, long start, long end, AbstractActor target)
<<<<<<<
int durationInMS = (int)(end - start);
int durationInS = durationInMS / 1000;
List<AbstractHealthDamageEvent> damageEvents = GetDamageEvents(target, log, start, end);
=======
IReadOnlyList<AbstractHealthDamageEvent> damageLogs = GetDamageLogs(target, log, phase.Start, phase.End);
>>>>>>>
int durationInMS = (int)(end - start);
int durationInS = durationInMS / 1000;
IReadOnlyList<AbstractHealthDamageEvent> damageEvents = GetDamageEvents(target, log, start, end);
<<<<<<<
public List<double> Get1SBreakbarDamageList(ParsedEvtcLog log,long start, long end, AbstractActor target)
=======
public IReadOnlyList<double> Get1SBreakbarDamageList(ParsedEvtcLog log, int phaseIndex, PhaseData phase, AbstractActor target)
>>>>>>>
public IReadOnlyList<double> Get1SBreakbarDamageList(ParsedEvtcLog log,long start, long end, AbstractActor target)
<<<<<<<
int durationInMS = (int)(end - start);
int durationInS = durationInMS / 1000;
List<AbstractBreakbarDamageEvent> breakbarDamageEvents = GetBreakbarDamageEvents(target, log, start, end);
=======
IReadOnlyList<AbstractBreakbarDamageEvent> breakbarDamageLogs = GetBreakbarDamageLogs(target, log, phase.Start, phase.End);
>>>>>>>
int durationInMS = (int)(end - start);
int durationInS = durationInMS / 1000;
IReadOnlyList<AbstractBreakbarDamageEvent> breakbarDamageEvents = GetBreakbarDamageEvents(target, log, start, end);
<<<<<<<
_buffDistribution = new CachingCollection<BuffDistribution>(log);
_buffPresence = new CachingCollection<Dictionary<long, long>>(log);
foreach (Buff buff in TrackedBuffs)
=======
IReadOnlyList<PhaseData> phases = log.FightData.GetPhases(log);
for (int i = 0; i < phases.Count; i++)
{
_buffDistribution.Add(new BuffDistribution());
_buffPresence.Add(new Dictionary<long, long>());
}
foreach (Buff buff in GetTrackedBuffs(log))
>>>>>>>
_buffDistribution = new CachingCollection<BuffDistribution>(log);
_buffPresence = new CachingCollection<Dictionary<long, long>>(log);
foreach (Buff buff in GetTrackedBuffs(log))
<<<<<<<
foreach (Buff buff in TrackedBuffs)
{
if (buffDistribution.HasBuffID(buff.ID))
=======
foreach (Buff buff in GetTrackedBuffs(log))
>>>>>>>
foreach (Buff buff in GetTrackedBuffs(log))
{
if (buffDistribution.HasBuffID(buff.ID))
<<<<<<<
public override List<AbstractCastEvent> GetCastEvents(ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractCastEvent> GetCastLogs(ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractCastEvent> GetCastEvents(ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractCastEvent> GetIntersectingCastEvents(ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractCastEvent> GetIntersectingCastLogs(ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractCastEvent> GetIntersectingCastEvents(ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractHealthDamageEvent> GetDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
DamageEvents = new List<AbstractHealthDamageEvent>();
DamageEvents.AddRange(log.CombatData.GetDamageData(AgentItem).Where(x => x.IFF != ArcDPSEnums.IFF.Friend));
Dictionary<long, Minions> minionsList = GetMinions(log);
=======
DamageLogs = new List<AbstractHealthDamageEvent>();
DamageLogs.AddRange(log.CombatData.GetDamageData(AgentItem).Where(x => x.IFF != ArcDPSEnums.IFF.Friend));
IReadOnlyDictionary<long, Minions> minionsList = GetMinions(log);
>>>>>>>
DamageEvents = new List<AbstractHealthDamageEvent>();
DamageEvents.AddRange(log.CombatData.GetDamageData(AgentItem).Where(x => x.IFF != ArcDPSEnums.IFF.Friend));
IReadOnlyDictionary<long, Minions> minionsList = GetMinions(log);
<<<<<<<
public List<AbstractHealthDamageEvent> GetJustActorDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public IReadOnlyList<AbstractHealthDamageEvent> GetJustActorDamageLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public IReadOnlyList<AbstractHealthDamageEvent> GetJustActorDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public List<AbstractBreakbarDamageEvent> GetJustActorBreakbarDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public IReadOnlyList<AbstractBreakbarDamageEvent> GetJustActorBreakbarDamageLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public IReadOnlyList<AbstractBreakbarDamageEvent> GetJustActorBreakbarDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractBreakbarDamageEvent> GetBreakbarDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
BreakbarDamageEvents = new List<AbstractBreakbarDamageEvent>();
BreakbarDamageEvents.AddRange(log.CombatData.GetBreakbarDamageData(AgentItem).Where(x => x.IFF != ArcDPSEnums.IFF.Friend));
Dictionary<long, Minions> minionsList = GetMinions(log);
=======
BreakbarDamageLogs = new List<AbstractBreakbarDamageEvent>();
BreakbarDamageLogs.AddRange(log.CombatData.GetBreakbarDamageData(AgentItem).Where(x => x.IFF != ArcDPSEnums.IFF.Friend));
IReadOnlyDictionary<long, Minions> minionsList = GetMinions(log);
>>>>>>>
BreakbarDamageEvents = new List<AbstractBreakbarDamageEvent>();
BreakbarDamageEvents.AddRange(log.CombatData.GetBreakbarDamageData(AgentItem).Where(x => x.IFF != ArcDPSEnums.IFF.Friend));
IReadOnlyDictionary<long, Minions> minionsList = GetMinions(log);
<<<<<<<
public override List<AbstractHealthDamageEvent> GetDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageTakenLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractBreakbarDamageEvent> GetBreakbarDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageTakenLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
internal List<AbstractHealthDamageEvent> GetJustActorHitDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
{
if (_hitSelfDamageEventsPerPhasePerTarget == null)
{
_hitSelfDamageEventsPerPhasePerTarget = new CachingCollectionWithTarget<List<AbstractHealthDamageEvent>>(log);
}
if (!_hitSelfDamageEventsPerPhasePerTarget.TryGetValue(start, end, target, out List<AbstractHealthDamageEvent> dls))
{
dls = GetHitDamageEvents(target, log, start, end).Where(x => x.From == AgentItem).ToList();
_hitSelfDamageEventsPerPhasePerTarget.Set(start, end, target, dls);
}
return dls;
}
internal List<AbstractHealthDamageEvent> GetJustActorConditionHitDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
{
if (_conditionHitSelfDamageEventsPerPhasePerTarget == null)
{
_conditionHitSelfDamageEventsPerPhasePerTarget = new CachingCollectionWithTarget<List<AbstractHealthDamageEvent>>(log);
}
if (!_conditionHitSelfDamageEventsPerPhasePerTarget.TryGetValue(start, end, target, out List<AbstractHealthDamageEvent> dls))
{
dls = GetJustActorHitDamageEvents(target, log, start, end).Where(x => x.IsCondi(log)).ToList();
_conditionHitSelfDamageEventsPerPhasePerTarget.Set(start, end, target, dls);
}
return dls;
}
internal List<AbstractHealthDamageEvent> GetJustActorPowerHitDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
internal IReadOnlyList<AbstractHealthDamageEvent> GetJustActorHitDamageLogs(AbstractActor target, ParsedEvtcLog log, PhaseData phase)
>>>>>>>
internal IReadOnlyList<AbstractHealthDamageEvent> GetJustActorHitDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
{
if (_hitSelfDamageEventsPerPhasePerTarget == null)
{
_hitSelfDamageEventsPerPhasePerTarget = new CachingCollectionWithTarget<List<AbstractHealthDamageEvent>>(log);
}
if (!_hitSelfDamageEventsPerPhasePerTarget.TryGetValue(start, end, target, out List<AbstractHealthDamageEvent> dls))
{
dls = GetHitDamageEvents(target, log, start, end).Where(x => x.From == AgentItem).ToList();
_hitSelfDamageEventsPerPhasePerTarget.Set(start, end, target, dls);
}
return dls;
}
internal IReadOnlyList<AbstractHealthDamageEvent> GetJustActorConditionHitDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
{
if (_conditionHitSelfDamageEventsPerPhasePerTarget == null)
{
_conditionHitSelfDamageEventsPerPhasePerTarget = new CachingCollectionWithTarget<List<AbstractHealthDamageEvent>>(log);
}
if (!_conditionHitSelfDamageEventsPerPhasePerTarget.TryGetValue(start, end, target, out List<AbstractHealthDamageEvent> dls))
{
dls = GetJustActorHitDamageEvents(target, log, start, end).Where(x => x.IsCondi(log)).ToList();
_conditionHitSelfDamageEventsPerPhasePerTarget.Set(start, end, target, dls);
}
return dls;
}
internal IReadOnlyList<AbstractHealthDamageEvent> GetJustActorPowerHitDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end) |
<<<<<<<
List<AbstractCastEvent> cls = actor.GetCastEvents(log, start, end);
=======
IReadOnlyList<AbstractCastEvent> cls = actor.GetCastLogs(log, start, end);
>>>>>>>
IReadOnlyList<AbstractCastEvent> cls = actor.GetCastEvents(log, start, end); |
<<<<<<<
mode = ParseMode.Fractal;
mechanicList.AddRange(new List<Mechanic>
{
new Mechanic(37154, "Lunge", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(50,150,0)',", "Charge",0),
new Mechanic(37278, "Upswing", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(255,200,0)',", "First Smash",0),
new Mechanic(36962, "Upswing", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(255,200,0)',", "Torment Smash",0),
new Mechanic(37466, "Nightmare Miasma", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(140,0,140)',", "Nightmare Miasma",0),
});
=======
mechanicList.AddRange(new List<Mechanic>
{
new Mechanic(37154, "Lunge", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(50,150,0)',", "Lunge",0),
new Mechanic(37278, "First Smash", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(100,150,0)',", "First Smash",0),
new Mechanic(36962, "Torment Smash", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(150,150,0)',", "Torment Smash",0)
});
>>>>>>>
mechanicList.AddRange(new List<Mechanic>
{
new Mechanic(37154, "Lunge", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(50,150,0)',", "Charge",0),
new Mechanic(37278, "Upswing", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(255,200,0)',", "First Smash",0),
new Mechanic(36962, "Upswing", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(255,200,0)',", "Torment Smash",0),
new Mechanic(37466, "Nightmare Miasma", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Ensolyss, "symbol:'circle',color:'rgb(140,0,140)',", "Nightmare Miasma",0),
}); |
<<<<<<<
if (pair.Value.First().IsCondi)
=======
if (!pair.Value.First().IsIndirectDamage && skill != null)
>>>>>>>
if (pair.Value.First().IsIndirectDamage)
<<<<<<<
string prefix = filteredList.First().IsCondi ? "b" : "s";
res.Add(new JsonDamageDist(filteredList, filteredList.First().IsCondi, pair.Key));
=======
string prefix = filteredList.First().IsIndirectDamage ? "b" : "s";
res[prefix + pair.Key] = new JsonDamageDist()
{
hits = filteredList.Count,
damage = filteredList.Sum(x => x.Damage),
min = filteredList.Min(x => x.Damage),
max = filteredList.Max(x => x.Damage),
flank = filteredList.Count(x => x.IsFlanking),
crit = filteredList.Count(x => x.Result == ParseEnum.Result.Crit),
glance = filteredList.Count(x => x.Result == ParseEnum.Result.Glance),
};
>>>>>>>
string prefix = filteredList.First().IsIndirectDamage ? "b" : "s";
res.Add(new JsonDamageDist(filteredList, filteredList.First().IsCondi, pair.Key)); |
<<<<<<<
public override List<AbstractHealthDamageEvent> GetDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractBreakbarDamageEvent> GetBreakbarDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractHealthDamageEvent> GetDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageTakenLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractHealthDamageEvent> GetDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractBreakbarDamageEvent> GetBreakbarDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageTakenLogs(AbstractActor target, ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractBreakbarDamageEvent> GetBreakbarDamageTakenEvents(AbstractActor target, ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractCastEvent> GetCastEvents(ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractCastEvent> GetCastLogs(ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractCastEvent> GetCastEvents(ParsedEvtcLog log, long start, long end)
<<<<<<<
public override List<AbstractCastEvent> GetIntersectingCastEvents(ParsedEvtcLog log, long start, long end)
=======
public override IReadOnlyList<AbstractCastEvent> GetIntersectingCastLogs(ParsedEvtcLog log, long start, long end)
>>>>>>>
public override IReadOnlyList<AbstractCastEvent> GetIntersectingCastEvents(ParsedEvtcLog log, long start, long end) |
<<<<<<<
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct EventCallback
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public static readonly Microsoft.AspNetCore.Components.EventCallback Empty;
public static readonly Microsoft.AspNetCore.Components.EventCallbackFactory Factory;
public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; }
public bool HasDelegate { get { throw null; } }
public System.Threading.Tasks.Task InvokeAsync(object arg) { throw null; }
}
=======
>>>>>>>
private readonly int _dummyPrimitive;
<<<<<<<
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct EventCallback<TValue>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public static readonly Microsoft.AspNetCore.Components.EventCallback<TValue> Empty;
public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; }
public bool HasDelegate { get { throw null; } }
public System.Threading.Tasks.Task InvokeAsync(TValue arg) { throw null; }
}
=======
>>>>>>>
private readonly int _dummyPrimitive; |
<<<<<<<
List<AbstractCastEvent> cls = dhuum.GetCastEvents(log, 0, log.FightData.FightEnd);
=======
IReadOnlyList<AbstractCastEvent> cls = dhuum.GetCastLogs(log, 0, log.FightData.FightEnd);
>>>>>>>
IReadOnlyList<AbstractCastEvent> cls = dhuum.GetCastEvents(log, 0, log.FightData.FightEnd);
<<<<<<<
List<AbstractCastEvent> castLogs = dhuum.GetCastEvents(log, 0, log.FightData.FightEnd);
List<AbstractCastEvent> dhuumCast = dhuum.GetCastEvents(log, 0, 20000);
=======
IReadOnlyList<AbstractCastEvent> castLogs = dhuum.GetCastLogs(log, 0, log.FightData.FightEnd);
IReadOnlyList<AbstractCastEvent> dhuumCast = dhuum.GetCastLogs(log, 0, 20000);
>>>>>>>
IReadOnlyList<AbstractCastEvent> castLogs = dhuum.GetCastEvents(log, 0, log.FightData.FightEnd);
IReadOnlyList<AbstractCastEvent> dhuumCast = dhuum.GetCastEvents(log, 0, 20000);
<<<<<<<
List<AbstractCastEvent> cls = target.GetCastEvents(log, 0, log.FightData.FightEnd);
=======
IReadOnlyList<AbstractCastEvent> cls = target.GetCastLogs(log, 0, log.FightData.FightEnd);
>>>>>>>
IReadOnlyList<AbstractCastEvent> cls = target.GetCastEvents(log, 0, log.FightData.FightEnd); |
<<<<<<<
Mode = ParseMode.Fractal;
=======
mode = ParseMode.Fractal;
mechanicList.AddRange(new List<Mechanic>
{
new Mechanic(37695, "Flux Bomb", Mechanic.MechType.PlayerBoon, ParseEnum.BossIDS.Unknown, "symbol:'circle',color:'rgb(150,0,255)',size:10,", "FBmb",0), // Flux Bomb application, Flux Bomb
new Mechanic(36393, "Flux Bomb", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Unknown, "symbol:'circle-open',color:'rgb(150,0,255)',size:10,", "FB.dmg",0), // Flux Bomb hit, Flux Bomb dmg
});
>>>>>>>
Mode = ParseMode.Fractal;
mechanicList.AddRange(new List<Mechanic>
{
new Mechanic(37695, "Flux Bomb", Mechanic.MechType.PlayerBoon, ParseEnum.BossIDS.Unknown, "symbol:'circle',color:'rgb(150,0,255)',size:10,", "FBmb",0), // Flux Bomb application, Flux Bomb
new Mechanic(36393, "Flux Bomb", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Unknown, "symbol:'circle-open',color:'rgb(150,0,255)',size:10,", "FB.dmg",0), // Flux Bomb hit, Flux Bomb dmg
}); |
<<<<<<<
HTMLBuilder builder = new HTMLBuilder(log, settings, statistics,uploadresult);
=======
var builder = new HTMLBuilder(log, settings, statistics);
>>>>>>>
var builder = new HTMLBuilder(log, settings, statistics,uploadresult);
<<<<<<<
CSVBuilder builder = new CSVBuilder(sw, ",",log, settings, statistics,uploadresult);
=======
var builder = new CSVBuilder(sw, ",",log, settings, statistics);
>>>>>>>
var builder = new CSVBuilder(sw, ",",log, settings, statistics,uploadresult); |
<<<<<<<
int transfoEnd = (int)(c.Time - log.FightData.FightStart);
replay.AddCircleActor(new CircleActor(true, 0, 160, new Tuple<int, int>(transfoStart, transfoEnd), "rgba(0, 80, 255, 0.3)"));
=======
int transfoEnd = (int)(c.Time - log.GetBossData().GetFirstAware());
replay.AddCircleActor(new CircleActor(true, 0, 180, new Tuple<int, int>(transfoStart, transfoEnd), "rgba(0, 80, 255, 0.3)"));
>>>>>>>
int transfoEnd = (int)(c.Time - log.FightData.FightStart);
replay.AddCircleActor(new CircleActor(true, 0, 180, new Tuple<int, int>(transfoStart, transfoEnd), "rgba(0, 80, 255, 0.3)")); |
<<<<<<<
public List<long> Conditions;
public string EncounterDuration;
public bool Success;
public string FightName;
public string FightIcon;
public bool CombatReplay;
public bool LightTheme;
public bool NoMechanics;
public bool SingleGroup;
=======
public List<long> conditions;
public string encounterDuration;
public bool success;
public string fightName;
public string fightIcon;
public bool lightTheme;
public bool noMechanics;
public bool singleGroup;
>>>>>>>
public List<long> Conditions;
public string EncounterDuration;
public bool Success;
public string FightName;
public string FightIcon;
public bool LightTheme;
public bool NoMechanics;
public bool SingleGroup; |
<<<<<<<
this.ClientSize = new System.Drawing.Size(579, 524);
this.Controls.Add(this.chkHtmlExperimental);
=======
this.ClientSize = new System.Drawing.Size(853, 553);
this.Controls.Add(this.UploadRaidar_check);
this.Controls.Add(this.UploadDRRH_check);
this.Controls.Add(this.UploadDPSReports_checkbox);
this.Controls.Add(this.label1);
>>>>>>>
this.ClientSize = new System.Drawing.Size(853, 553);
this.Controls.Add(this.UploadRaidar_check);
this.Controls.Add(this.UploadDRRH_check);
this.Controls.Add(this.UploadDPSReports_checkbox);
this.Controls.Add(this.label1);
this.Controls.Add(this.chkHtmlExperimental); |
<<<<<<<
this.label1 = new System.Windows.Forms.Label();
this.UploadDPSReports_checkbox = new System.Windows.Forms.CheckBox();
this.UploadDRRH_check = new System.Windows.Forms.CheckBox();
this.UploadRaidar_check = new System.Windows.Forms.CheckBox();
=======
this.json = new System.Windows.Forms.Label();
this.chkOutputJson = new System.Windows.Forms.CheckBox();
this.chkIndentJSON = new System.Windows.Forms.CheckBox();
>>>>>>>
this.label1 = new System.Windows.Forms.Label();
this.UploadDPSReports_checkbox = new System.Windows.Forms.CheckBox();
this.UploadDRRH_check = new System.Windows.Forms.CheckBox();
this.UploadRaidar_check = new System.Windows.Forms.CheckBox();
this.json = new System.Windows.Forms.Label();
this.chkOutputJson = new System.Windows.Forms.CheckBox();
this.chkIndentJSON = new System.Windows.Forms.CheckBox();
<<<<<<<
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(614, 306);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(76, 24);
this.label1.TabIndex = 42;
this.label1.Text = "Upload";
//
// UploadDPSReports_checkbox
//
this.UploadDPSReports_checkbox.AutoSize = true;
this.UploadDPSReports_checkbox.Location = new System.Drawing.Point(589, 333);
this.UploadDPSReports_checkbox.Name = "UploadDPSReports_checkbox";
this.UploadDPSReports_checkbox.Size = new System.Drawing.Size(196, 17);
this.UploadDPSReports_checkbox.TabIndex = 43;
this.UploadDPSReports_checkbox.Text = "Upload to DPSReports Elite Insights";
this.UploadDPSReports_checkbox.UseVisualStyleBackColor = true;
this.UploadDPSReports_checkbox.CheckedChanged += new System.EventHandler(this.UploadDPSReports_checkbox_CheckedChanged);
//
// UploadDRRH_check
//
this.UploadDRRH_check.AutoSize = true;
this.UploadDRRH_check.Location = new System.Drawing.Point(589, 356);
this.UploadDRRH_check.Name = "UploadDRRH_check";
this.UploadDRRH_check.Size = new System.Drawing.Size(193, 17);
this.UploadDRRH_check.TabIndex = 44;
this.UploadDRRH_check.Text = "Upload to DPSReports RaidHeroes";
this.UploadDRRH_check.UseVisualStyleBackColor = true;
this.UploadDRRH_check.CheckedChanged += new System.EventHandler(this.UploadDRRH_check_CheckedChanged);
//
// UploadRaidar_check
//
this.UploadRaidar_check.AutoSize = true;
this.UploadRaidar_check.Location = new System.Drawing.Point(589, 379);
this.UploadRaidar_check.Name = "UploadRaidar_check";
this.UploadRaidar_check.Size = new System.Drawing.Size(175, 17);
this.UploadRaidar_check.TabIndex = 45;
this.UploadRaidar_check.Text = "Upload to Raidar (Not Working)";
this.UploadRaidar_check.UseVisualStyleBackColor = true;
this.UploadRaidar_check.CheckedChanged += new System.EventHandler(this.UploadRaidar_check_CheckedChanged);
//
=======
// json
//
this.json.AutoSize = true;
this.json.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.json.Location = new System.Drawing.Point(440, 356);
this.json.Name = "json";
this.json.Size = new System.Drawing.Size(54, 24);
this.json.TabIndex = 42;
this.json.Text = "Json";
//
// chkOutputJson
//
this.chkOutputJson.AutoSize = true;
this.chkOutputJson.Location = new System.Drawing.Point(456, 383);
this.chkOutputJson.Name = "chkOutputJson";
this.chkOutputJson.Size = new System.Drawing.Size(103, 17);
this.chkOutputJson.TabIndex = 43;
this.chkOutputJson.Text = "Output as JSON";
this.chkOutputJson.UseVisualStyleBackColor = true;
this.chkOutputJson.CheckedChanged += new System.EventHandler(this.OutputJSONCheckedChanged);
//
// chkIndentJSON
//
this.chkIndentJSON.AutoSize = true;
this.chkIndentJSON.Location = new System.Drawing.Point(456, 406);
this.chkIndentJSON.Name = "chkIndentJSON";
this.chkIndentJSON.Size = new System.Drawing.Size(87, 17);
this.chkIndentJSON.TabIndex = 44;
this.chkIndentJSON.Text = "Indent JSON";
this.chkIndentJSON.UseVisualStyleBackColor = true;
this.chkIndentJSON.CheckedChanged += new System.EventHandler(this.chkIndentJSONCheckedChanged);
//
>>>>>>>
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(614, 306);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(76, 24);
this.label1.TabIndex = 42;
this.label1.Text = "Upload";
//
// UploadDPSReports_checkbox
//
this.UploadDPSReports_checkbox.AutoSize = true;
this.UploadDPSReports_checkbox.Location = new System.Drawing.Point(589, 333);
this.UploadDPSReports_checkbox.Name = "UploadDPSReports_checkbox";
this.UploadDPSReports_checkbox.Size = new System.Drawing.Size(196, 17);
this.UploadDPSReports_checkbox.TabIndex = 43;
this.UploadDPSReports_checkbox.Text = "Upload to DPSReports Elite Insights";
this.UploadDPSReports_checkbox.UseVisualStyleBackColor = true;
this.UploadDPSReports_checkbox.CheckedChanged += new System.EventHandler(this.UploadDPSReports_checkbox_CheckedChanged);
//
// UploadDRRH_check
//
this.UploadDRRH_check.AutoSize = true;
this.UploadDRRH_check.Location = new System.Drawing.Point(589, 356);
this.UploadDRRH_check.Name = "UploadDRRH_check";
this.UploadDRRH_check.Size = new System.Drawing.Size(193, 17);
this.UploadDRRH_check.TabIndex = 44;
this.UploadDRRH_check.Text = "Upload to DPSReports RaidHeroes";
this.UploadDRRH_check.UseVisualStyleBackColor = true;
this.UploadDRRH_check.CheckedChanged += new System.EventHandler(this.UploadDRRH_check_CheckedChanged);
//
// UploadRaidar_check
//
this.UploadRaidar_check.AutoSize = true;
this.UploadRaidar_check.Location = new System.Drawing.Point(589, 379);
this.UploadRaidar_check.Name = "UploadRaidar_check";
this.UploadRaidar_check.Size = new System.Drawing.Size(175, 17);
this.UploadRaidar_check.TabIndex = 45;
this.UploadRaidar_check.Text = "Upload to Raidar (Not Working)";
this.UploadRaidar_check.UseVisualStyleBackColor = true;
this.UploadRaidar_check.CheckedChanged += new System.EventHandler(this.UploadRaidar_check_CheckedChanged);
//
// json
//
this.json.AutoSize = true;
this.json.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.json.Location = new System.Drawing.Point(440, 356);
this.json.Name = "json";
this.json.Size = new System.Drawing.Size(54, 24);
this.json.TabIndex = 42;
this.json.Text = "Json";
//
// chkOutputJson
//
this.chkOutputJson.AutoSize = true;
this.chkOutputJson.Location = new System.Drawing.Point(456, 383);
this.chkOutputJson.Name = "chkOutputJson";
this.chkOutputJson.Size = new System.Drawing.Size(103, 17);
this.chkOutputJson.TabIndex = 43;
this.chkOutputJson.Text = "Output as JSON";
this.chkOutputJson.UseVisualStyleBackColor = true;
this.chkOutputJson.CheckedChanged += new System.EventHandler(this.OutputJSONCheckedChanged);
//
// chkIndentJSON
//
this.chkIndentJSON.AutoSize = true;
this.chkIndentJSON.Location = new System.Drawing.Point(456, 406);
this.chkIndentJSON.Name = "chkIndentJSON";
this.chkIndentJSON.Size = new System.Drawing.Size(87, 17);
this.chkIndentJSON.TabIndex = 44;
this.chkIndentJSON.Text = "Indent JSON";
this.chkIndentJSON.UseVisualStyleBackColor = true;
this.chkIndentJSON.CheckedChanged += new System.EventHandler(this.chkIndentJSONCheckedChanged);
//
<<<<<<<
this.ClientSize = new System.Drawing.Size(797, 528);
this.Controls.Add(this.UploadRaidar_check);
this.Controls.Add(this.UploadDRRH_check);
this.Controls.Add(this.UploadDPSReports_checkbox);
this.Controls.Add(this.label1);
=======
this.ClientSize = new System.Drawing.Size(579, 524);
this.Controls.Add(this.chkIndentJSON);
this.Controls.Add(this.chkOutputJson);
this.Controls.Add(this.json);
>>>>>>>
this.ClientSize = new System.Drawing.Size(797, 528);
this.Controls.Add(this.UploadRaidar_check);
this.Controls.Add(this.UploadDRRH_check);
this.Controls.Add(this.UploadDPSReports_checkbox);
this.Controls.Add(this.label1);
this.ClientSize = new System.Drawing.Size(579, 524);
this.Controls.Add(this.chkIndentJSON);
this.Controls.Add(this.chkOutputJson);
this.Controls.Add(this.json);
<<<<<<<
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox UploadDPSReports_checkbox;
private System.Windows.Forms.CheckBox UploadDRRH_check;
private System.Windows.Forms.CheckBox UploadRaidar_check;
=======
private System.Windows.Forms.Label json;
private System.Windows.Forms.CheckBox chkOutputJson;
private System.Windows.Forms.CheckBox chkIndentJSON;
>>>>>>>
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox UploadDPSReports_checkbox;
private System.Windows.Forms.CheckBox UploadDRRH_check;
private System.Windows.Forms.CheckBox UploadRaidar_check;
private System.Windows.Forms.Label json;
private System.Windows.Forms.CheckBox chkOutputJson;
private System.Windows.Forms.CheckBox chkIndentJSON; |
<<<<<<<
public IConfiguration Configuration { get; set; }
public IHostingEnvironment Environment { get; set; }
private void CheckSameSite(HttpContext httpContext, CookieOptions options)
{
if (options.SameSite > (SameSiteMode)(-1))
{
var userAgent = httpContext.Request.Headers["User-Agent"].ToString();
// TODO: Use your User Agent library of choice here.
if (userAgent.Contains("CPU iPhone OS 12") // Also covers iPod touch
|| userAgent.Contains("iPad; CPU OS 12")
// Safari 12 and 13 are both broken on Mojave
|| userAgent.Contains("Macintosh; Intel Mac OS X 10_14"))
{
options.SameSite = (SameSiteMode)(-1);
}
}
}
=======
>>>>>>> |
<<<<<<<
Id = skill.ID,
Name = skill.Name,
Icon = skill.Icon,
Aa = (apiSkill?.slot == "Weapon_1")
=======
id = skill.ID,
name = skill.Name,
icon = skill.Icon,
aa = (apiSkill?.Slot == "Weapon_1")
>>>>>>>
Id = skill.ID,
Name = skill.Name,
Icon = skill.Icon,
Aa = (apiSkill?.Slot == "Weapon_1") |
<<<<<<<
=======
new Boon("Stun", 872, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.ForceOverride, "https://wiki.guildwars2.com/images/9/97/Stun.png"),
new Boon("Daze", 833, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.ForceOverride, "https://wiki.guildwars2.com/images/7/79/Daze.png"),
new Boon("Exposed", 48209, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.Override,"https://wiki.guildwars2.com/images/f/f4/Exposed_%28effect%29.png"),
// Fractals
new Boon("Rigorous Certainty", 33652, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.DefensiveBuffTable, Logic.ForceOverride,"https://wiki.guildwars2.com/images/6/60/Desert_Carapace.png"),
new Boon("Fractal Mobility", 33024, BoonSource.Mixed, BoonType.Intensity, 5, BoonNature.Consumable, Logic.ForceOverride,"https://wiki.guildwars2.com/images/thumb/2/22/Mist_Mobility_Potion.png/40px-Mist_Mobility_Potion.png"),
new Boon("Fractal Defensive", 32134, BoonSource.Mixed, BoonType.Intensity, 5, BoonNature.Consumable, Logic.ForceOverride,"https://wiki.guildwars2.com/images/thumb/e/e6/Mist_Defensive_Potion.png/40px-Mist_Defensive_Potion.png"),
new Boon("Fractal Offensive", 32473, BoonSource.Mixed, BoonType.Intensity, 5, BoonNature.Consumable, Logic.ForceOverride,"https://wiki.guildwars2.com/images/thumb/8/8d/Mist_Offensive_Potion.png/40px-Mist_Offensive_Potion.png"),
// Sigils and Runes
new Boon("Sigil of Concentration", 33719, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/b/b3/Superior_Sigil_of_Concentration.png"),
new Boon("Superior Rune of the Monk", 53285, BoonSource.Mixed, BoonType.Intensity, 10, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/1/18/Superior_Rune_of_the_Monk.png"),
new Boon("Sigil of Corruption", 9374, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/1/18/Superior_Sigil_of_Corruption.png"),
new Boon("Sigil of Life", 9386, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/a/a7/Superior_Sigil_of_Life.png"),
new Boon("Sigil of Perception", 9385, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/c/cc/Superior_Sigil_of_Perception.png"),
new Boon("Sigil of Bloodlust", 9286, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/f/fb/Superior_Sigil_of_Bloodlust.png"),
new Boon("Sigil of Bounty", 38588, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/f/f8/Superior_Sigil_of_Bounty.png"),
new Boon("Sigil of Benevolence", 9398, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/5/59/Superior_Sigil_of_Benevolence.png"),
new Boon("Sigil of Momentum", 22144, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/3/30/Superior_Sigil_of_Momentum.png"),
new Boon("Sigil of the Stars", 46953, BoonSource.Mixed, BoonType.Intensity, 25, BoonNature.GraphOnlyBuff, Logic.Override, "https://wiki.guildwars2.com/images/d/dc/Superior_Sigil_of_the_Stars.png"),
>>>>>>>
new Boon("Stun", 872, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.ForceOverride, "https://wiki.guildwars2.com/images/9/97/Stun.png"),
new Boon("Daze", 833, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.ForceOverride, "https://wiki.guildwars2.com/images/7/79/Daze.png"),
new Boon("Exposed", 48209, BoonSource.Mixed, BoonType.Duration, 1, BoonNature.GraphOnlyBuff, Logic.Override,"https://wiki.guildwars2.com/images/f/f4/Exposed_%28effect%29.png"), |
<<<<<<<
NPC mainTarget = Targets.Find(x => x.ID == TriggerID);
=======
Target mainTarget = Targets.Find(x => x.ID == GenericTriggerID);
>>>>>>>
NPC mainTarget = Targets.Find(x => x.ID == GenericTriggerID); |
<<<<<<<
NPC target = Targets.Find(x => x.ID == TriggerID);
NPC leftArm = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.CALeftArm);
NPC rightArm = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.CARightArm);
=======
Target target = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.ConjuredAmalgamate);
Target leftArm = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.CALeftArm);
Target rightArm = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.CARightArm);
>>>>>>>
NPC target = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.ConjuredAmalgamate);
NPC leftArm = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.CALeftArm);
NPC rightArm = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.CARightArm); |
<<<<<<<
private List<int> _data = new List<int>();
=======
protected List<(double angle, long time)> Data = new List<(double angle, long time)>();
>>>>>>>
protected List<int> Data = new List<int>();
<<<<<<<
_data.Add(-Point3D.GetRotationFromFacing(facing));
=======
Data.Add((Point3D.GetRotationFromFacing(facing), facing.Time));
>>>>>>>
Data.Add(-Point3D.GetRotationFromFacing(facing));
<<<<<<<
foreach(int angle in _data)
=======
foreach((double angle, long time) in Data)
>>>>>>>
foreach(int angle in Data) |
<<<<<<<
List<AbstractCastEvent> castLogs = mainTarget.GetCastEvents(log, 0, log.FightData.FightEnd);
AbstractCastEvent abo = castLogs.Find(x => x.SkillId == 34427);
=======
IReadOnlyList<AbstractCastEvent> castLogs = mainTarget.GetCastLogs(log, 0, log.FightData.FightEnd);
AbstractCastEvent abo = castLogs.FirstOrDefault(x => x.SkillId == 34427);
>>>>>>>
IReadOnlyList<AbstractCastEvent> castLogs = mainTarget.GetCastEvents(log, 0, log.FightData.FightEnd);
AbstractCastEvent abo = castLogs.FirstOrDefault(x => x.SkillId == 34427);
<<<<<<<
List<AbstractCastEvent> cls = target.GetCastEvents(log, 0, log.FightData.FightEnd);
=======
IReadOnlyList<AbstractCastEvent> cls = target.GetCastLogs(log, 0, log.FightData.FightEnd);
>>>>>>>
IReadOnlyList<AbstractCastEvent> cls = target.GetCastEvents(log, 0, log.FightData.FightEnd); |
<<<<<<<
int totalDamage = GetTotalDamage(p, log, target, phase.Start, phase.End);
List<AbstractHealthDamageEvent> typeHits = GetHitDamageLogs(p, log, target, phase.Start, phase.End);
=======
int totalDamage = GetTotalDamage(p, log, target, i);
IReadOnlyList<AbstractHealthDamageEvent> typeHits = GetHitDamageLogs(p, log, target, phases[i]);
>>>>>>>
int totalDamage = GetTotalDamage(p, log, target, phase.Start, phase.End);
IReadOnlyList<AbstractHealthDamageEvent> typeHits = GetHitDamageLogs(p, log, target, phase.Start, phase.End);
<<<<<<<
int totalDamage = GetTotalDamage(p, log, null, phase.Start, phase.End);
List<AbstractHealthDamageEvent> typeHits = GetHitDamageLogs(p, log, null, phase.Start, phase.End);
=======
int totalDamage = GetTotalDamage(p, log, null, i);
IReadOnlyList<AbstractHealthDamageEvent> typeHits = GetHitDamageLogs(p, log, null, phases[i]);
>>>>>>>
int totalDamage = GetTotalDamage(p, log, null, phase.Start, phase.End);
IReadOnlyList<AbstractHealthDamageEvent> typeHits = GetHitDamageLogs(p, log, null, phase.Start, phase.End); |
<<<<<<<
private List<Point3D> _positions = new List<Point3D>();
private List<Point3D> _velocities = new List<Point3D>();
public List<Point3D> Rotations { get; } = new List<Point3D>();
=======
public List<Point3D> Positions { get; private set; } = new List<Point3D>();
public List<Point3D> Velocities { get; private set; } = new List<Point3D>();
public List<int> Times => Positions.Select(x => (int)x.Time).ToList();
>>>>>>>
public List<Point3D> Positions { get; private set; } = new List<Point3D>();
public List<Point3D> Velocities { get; private set; } = new List<Point3D>();
public List<int> Times => Positions.Select(x => (int)x.Time).ToList();
public List<Point3D> Rotations { get; } = new List<Point3D>(); |
<<<<<<<
TotalDamageDist[i] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageEvents(null, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
=======
totalDamageDist[i] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageLogs(null, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
>>>>>>>
totalDamageDist[i] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageEvents(null, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
<<<<<<<
TargetDamageDist[i][j] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageEvents(target, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
=======
targetDamageDist[i][j] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageLogs(target, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
>>>>>>>
targetDamageDist[i][j] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageEvents(target, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc); |
<<<<<<<
public readonly string BuildVersion;
public string PoV { get; private set; } = "N/A";
public string LogStart { get; private set; } = "yyyy-MM-dd HH:mm:ss z";
public string LogEnd { get; private set; } = "yyyy-MM-dd HH:mm:ss z";
=======
public readonly String BuildVersion;
public String PoV { get; private set; } = "N/A";
public String LogStart { get; private set; } = "yyyy-MM-dd HH:mm:ss z";
public String LogEnd { get; private set; } = "yyyy-MM-dd HH:mm:ss z";
public long EncounterLength { get; set; } = 0;
>>>>>>>
public readonly string BuildVersion;
public string PoV { get; private set; } = "N/A";
public string LogStart { get; private set; } = "yyyy-MM-dd HH:mm:ss z";
public string LogEnd { get; private set; } = "yyyy-MM-dd HH:mm:ss z";
public long EncounterLength { get; set; } = 0; |
<<<<<<<
// UTILITIES
=======
new Boon("Avocado Smoothie",50091, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/8/83/Avocado_Smoothie.png"),
new Boon("Carrot Souffle",-1, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/7/71/Carrot_Souffl%C3%A9.png"), //same as Dragon's_Breath_Bun
new Boon("Plate of Truffle Steak Dinner",-1, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/9/92/Plate_of_Truffle_Steak_Dinner.png"), //same as Dragon's Breath Bun
new Boon("Dragon's Breath Bun",9750, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/5/53/Dragon%27s_Breath_Bun.png"),
new Boon("Karka Egg Omelet",9756, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/9/9e/Karka_Egg_Omelet.png"),
new Boon("Steamed Red Dumpling",26536, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/8/8c/Steamed_Red_Dumpling.png"),
new Boon("Saffron Stuffed Mushroom",-1, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/e/e2/Saffron_Stuffed_Mushroom.png"), //same as Karka Egg Omelet
/// UTILITIES
>>>>>>>
new Boon("Avocado Smoothie",50091, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/8/83/Avocado_Smoothie.png"),
new Boon("Carrot Souffle",-1, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/7/71/Carrot_Souffl%C3%A9.png"), //same as Dragon's_Breath_Bun
new Boon("Plate of Truffle Steak Dinner",-1, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/9/92/Plate_of_Truffle_Steak_Dinner.png"), //same as Dragon's Breath Bun
new Boon("Dragon's Breath Bun",9750, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/5/53/Dragon%27s_Breath_Bun.png"),
new Boon("Karka Egg Omelet",9756, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/9/9e/Karka_Egg_Omelet.png"),
new Boon("Steamed Red Dumpling",26536, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/8/8c/Steamed_Red_Dumpling.png"),
new Boon("Saffron Stuffed Mushroom",-1, BoonSource.Item, BoonType.Duration, 1, BoonEnum.Food,RemoveType.None, Logic.Override, "https://wiki.guildwars2.com/images/e/e2/Saffron_Stuffed_Mushroom.png"), //same as Karka Egg Omelet
// UTILITIES |
<<<<<<<
List<AbstractCastEvent> cls = target.GetCastEvents(log, 0, log.FightData.FightEnd);
=======
IReadOnlyList<AbstractCastEvent> cls = target.GetCastLogs(log, 0, log.FightData.FightEnd);
>>>>>>>
IReadOnlyList<AbstractCastEvent> cls = target.GetCastEvents(log, 0, log.FightData.FightEnd); |
<<<<<<<
RxThread = new Thread(RxProc) {IsBackground = true};
=======
RxThread = new Thread(RxProc) { IsBackground = true };
>>>>>>>
RxThread = new Thread(RxProc) { IsBackground = true };
<<<<<<<
private void SetHealth(short health)
{
if (health > 20)
{
health = 20;
}
PacketHandler.SendPacket(new UpdateHealthPacket {Health = health});
}
=======
private void SetHealth(short health)
{
if (health > 20)
{
health = 20;
}
PacketHandler.SendPacket(new UpdateHealthPacket { Health = health });
}
>>>>>>>
private void SetHealth(short health)
{
if (health > 20)
{
health = 20;
}
PacketHandler.SendPacket(new UpdateHealthPacket {Health = health});
}
private void SetHealth(short health)
{
if (health > 20)
{
health = 20;
}
PacketHandler.SendPacket(new UpdateHealthPacket { Health = health });
} |
<<<<<<<
using System.Linq;
=======
using System.Collections.Generic;
>>>>>>>
using System.Linq;
using System.Collections.Generic; |
<<<<<<<
Register(PacketType.Transaction,5,0, ReadTransaction);
=======
Register(PacketType.UpdateSign, 0, 11, ReadUpdateSign);
>>>>>>>
Register(PacketType.Transaction,5,0, ReadTransaction);
Register(PacketType.UpdateSign, 0, 11, ReadUpdateSign);
<<<<<<<
public static void ReadTransaction(Client client, PacketReader reader)
{
TransactionPacket tp = new TransactionPacket();
tp.Read(reader);
if (!reader.Failed)
Client.HandleTransactionPacket(client, tp);
}
=======
public static void ReadUpdateSign(Client client, PacketReader reader)
{
UpdateSignPacket us = new UpdateSignPacket();
us.Read(reader);
if (!reader.Failed)
Client.HandlePacketUpdateSign(client, us);
}
>>>>>>>
public static void ReadTransaction(Client client, PacketReader reader)
{
TransactionPacket tp = new TransactionPacket();
tp.Read(reader);
if (!reader.Failed)
Client.HandleTransactionPacket(client, tp);
}
public static void ReadUpdateSign(Client client, PacketReader reader)
{
UpdateSignPacket us = new UpdateSignPacket();
us.Read(reader);
if (!reader.Failed)
Client.HandlePacketUpdateSign(client, us);
} |
<<<<<<<
using System.Net.Sockets;
#if NET46
=======
>>>>>>>
#if NET46
<<<<<<<
public static bool TryParseTemplate(string template, out Template result, out string error)
=======
public static bool TryParseTemplate(string template, out Template result, out string error, bool haltOnError = true)
>>>>>>>
public static bool TryParseTemplate(string template, out Template result, out string error, bool haltOnError = true)
<<<<<<<
cached = new Template(Template.End().Parse(template));
AddToCache(template, cached);
=======
cached = new Template(parser.End().Parse(template));
Cache.Set(template, cached, new CacheItemPolicy { SlidingExpiration = TimeSpan.FromMinutes(10) });
>>>>>>>
cached = new Template(parser.End().Parse(template));
Cache.Set(template, cached, new CacheItemPolicy() { SlidingExpiration = TimeSpan.FromMinutes(10) }); |
<<<<<<<
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "foo", CSharpSymbolType.Identifier)
.Accepts(AcceptedCharactersInternal.NonWhiteSpace)
.With(new DirectiveTokenChunkGenerator(CSharpCodeParser.SectionDirectiveDescriptor.Tokens.First())),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
=======
Factory.MetaCode("section").Accepts(AcceptedCharacters.None),
Factory.Span(SpanKind.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.WhiteSpace),
Factory.Span(SpanKind.Code, "foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKind.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharacters.None),
>>>>>>>
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
<<<<<<<
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier)
.Accepts(AcceptedCharactersInternal.NonWhiteSpace)
.With(new DirectiveTokenChunkGenerator(CSharpCodeParser.SectionDirectiveDescriptor.Tokens.First())),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
=======
Factory.MetaCode("section").Accepts(AcceptedCharacters.None),
Factory.Span(SpanKind.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.WhiteSpace),
Factory.Span(SpanKind.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKind.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharacters.None),
>>>>>>>
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
<<<<<<<
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier)
.Accepts(AcceptedCharactersInternal.NonWhiteSpace)
.With(new DirectiveTokenChunkGenerator(CSharpCodeParser.SectionDirectiveDescriptor.Tokens.First())),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None),
=======
Factory.MetaCode("section").Accepts(AcceptedCharacters.None),
Factory.Span(SpanKind.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.WhiteSpace),
Factory.Span(SpanKind.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKind.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharacters.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharacters.None),
>>>>>>>
Factory.MetaCode("section").Accepts(AcceptedCharactersInternal.None),
Factory.Span(SpanKindInternal.Code, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.WhiteSpace),
Factory.Span(SpanKindInternal.Code, "Foo", CSharpSymbolType.Identifier).AsDirectiveToken(CSharpCodeParser.SectionDirectiveDescriptor.Tokens[0]),
Factory.Span(SpanKindInternal.Markup, " ", CSharpSymbolType.WhiteSpace).Accepts(AcceptedCharactersInternal.AllWhiteSpace),
Factory.MetaCode("{").AutoCompleteWith(null, atEndOfSpan: true).Accepts(AcceptedCharactersInternal.None), |
<<<<<<<
[Test]
public void SetPostDownloadStatus_Invalid_EpisodeId()
{
var db = MockLib.GetEmptyDatabase();
var mocker = new AutoMoqer();
mocker.SetConstant(db);
var postDownloadStatus = PostDownloadStatusType.Failed;
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.SeriesId = 12345)
.With(s => s.CleanTitle = "officeus")
.Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
.WhereAll()
.Have(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build();
db.Insert(fakeSeries);
db.InsertMany(fakeEpisodes);
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
//Act
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>{300}, postDownloadStatus);
//Assert
var result = db.Fetch<Episode>();
result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0);
}
[Test]
[ExpectedException(typeof(SqlCeException))]
public void SetPostDownloadStatus_No_EpisodeId_In_Database()
{
var db = MockLib.GetEmptyDatabase();
var mocker = new AutoMoqer();
mocker.SetConstant(db);
var postDownloadStatus = PostDownloadStatusType.Failed;
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.SeriesId = 12345)
.With(s => s.CleanTitle = "officeus")
.Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
.WhereAll()
.Have(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build();
db.Insert(fakeSeries);
db.InsertMany(fakeEpisodes);
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
//Act
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), postDownloadStatus);
//Assert
var result = db.Fetch<Episode>();
result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0);
}
=======
[Test]
[ExpectedException(typeof(ArgumentException))]
public void SetPostDownloadStatus_should_throw_if_episode_list_is_empty()
{
var mocker = new AutoMoqer();
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), PostDownloadStatusType.Failed);
}
>>>>>>>
[Test]
public void SetPostDownloadStatus_Invalid_EpisodeId()
{
var db = MockLib.GetEmptyDatabase();
var mocker = new AutoMoqer();
mocker.SetConstant(db);
var postDownloadStatus = PostDownloadStatusType.Failed;
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.SeriesId = 12345)
.With(s => s.CleanTitle = "officeus")
.Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
.WhereAll()
.Have(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build();
db.Insert(fakeSeries);
db.InsertMany(fakeEpisodes);
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
//Act
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>{300}, postDownloadStatus);
//Assert
var result = db.Fetch<Episode>();
result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0);
}
[Test]
[ExpectedException(typeof(SqlCeException))]
public void SetPostDownloadStatus_No_EpisodeId_In_Database()
{
var db = MockLib.GetEmptyDatabase();
var mocker = new AutoMoqer();
mocker.SetConstant(db);
var postDownloadStatus = PostDownloadStatusType.Failed;
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.SeriesId = 12345)
.With(s => s.CleanTitle = "officeus")
.Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
.WhereAll()
.Have(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build();
db.Insert(fakeSeries);
db.InsertMany(fakeEpisodes);
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
//Act
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), postDownloadStatus);
//Assert
var result = db.Fetch<Episode>();
result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0);
}
[ExpectedException(typeof(ArgumentException))]
public void SetPostDownloadStatus_should_throw_if_episode_list_is_empty()
{
var mocker = new AutoMoqer();
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), PostDownloadStatusType.Failed);
} |
<<<<<<<
using Ninject;
=======
using NzbDrone.Model;
>>>>>>>
using Ninject;
using NzbDrone.Model;
<<<<<<<
=======
public virtual AuthenticationType AuthenticationType
{
get { return (AuthenticationType)GetValueInt("AuthenticationType", 0); }
set { SetValue("AuthenticationType", (int)value); }
}
>>>>>>>
public virtual AuthenticationType AuthenticationType
{
get { return (AuthenticationType)GetValueInt("AuthenticationType", 0); }
}
<<<<<<<
private void WriteDefaultConfig()
=======
public virtual string GetValue(string key, object defaultValue, string parent = null)
>>>>>>>
public virtual string GetValue(string key, object defaultValue, string parent = null) |
<<<<<<<
var progressNotification = new ProgressNotification("Settings");
_notificationProvider.Register(progressNotification);
=======
>>>>>>>
_notificationProvider.Register(progressNotification);
<<<<<<<
var progressNotification = new ProgressNotification("Settings");
_notificationProvider.Register(progressNotification);
=======
>>>>>>>
_notificationProvider.Register(progressNotification);
<<<<<<<
var progressNotification = new ProgressNotification("Settings");
_notificationProvider.Register(progressNotification);
=======
>>>>>>>
_notificationProvider.Register(progressNotification);
<<<<<<<
var progressNotification = new ProgressNotification("Settings");
_notificationProvider.Register(progressNotification);
=======
>>>>>>>
_notificationProvider.Register(progressNotification);
<<<<<<<
var progressNotification = new ProgressNotification("Settings");
_notificationProvider.Register(progressNotification);
=======
>>>>>>>
_notificationProvider.Register(progressNotification); |
<<<<<<<
_logger.Info("Skipping refresh of artist: {0}", artist.ArtistName);
_diskScanService.Scan(artist);
=======
_logger.Info("Skipping refresh of artist: {0}", artist.Name);
//TODO: _diskScanService.Scan(artist);
>>>>>>>
_logger.Info("Skipping refresh of artist: {0}", artist.Name);
_diskScanService.Scan(artist); |
<<<<<<<
public override bool SupportsPaging
{
get
{
return false;
}
}
=======
public override IEnumerable<string> GetSearchUrls(string query, int offset)
{
return new List<string>();
}
>>>>>>>
public override IEnumerable<string> GetSearchUrls(string query, int offset)
{
return new List<string>();
}
public override bool SupportsPaging
{
get
{
return false;
}
} |
<<<<<<<
using NzbDrone.Model;
=======
using Ninject;
>>>>>>>
using Ninject;
using NzbDrone.Model;
<<<<<<<
public virtual AuthenticationType AuthenticationType
{
get { return (AuthenticationType)GetValueInt("AuthenticationType", 0); }
set { SetValue("AuthenticationType", (int)value); }
}
=======
>>>>>>>
public virtual AuthenticationType AuthenticationType
{
get { return (AuthenticationType)GetValueInt("AuthenticationType", 0); }
set { SetValue("AuthenticationType", (int)value); }
}
<<<<<<<
public virtual string GetValue(string key, object defaultValue, string parent = null)
=======
private void WriteDefaultConfig()
>>>>>>>
private string GetValue(string key, object defaultValue, string parent = null) |
<<<<<<<
[Row("2011.01.10 - Denis Leary - HD TV.mkv", 2011, 1, 10)]
[Row("2011.03.13 - Denis Leary - HD TV.mkv", 2011, 3, 13)]
=======
[Row("2011.01.10 - Denis Leary - HD TV.mkv","", 2011, 1, 10)]
[Row("2011.03.13 - Denis Leary - HD TV.mkv", "", 2011, 3, 13)]
[Row("2011-03-13 - Denis Leary - HD TV.mkv", "", 2011, 3, 13)]
>>>>>>>
[Row("2011.01.10 - Denis Leary - HD TV.mkv","", 2011, 1, 10)]
[Row("2011.03.13 - Denis Leary - HD TV.mkv", "", 2011, 3, 13)] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.