A private Canadian university that forbids sex outside the confines of heterosexual marriage has taken its fight to set up a law school to court, in a case that is testing the balance between same-sex equality rights and freedom of religion.

The Evangelical Trinity Western University launched a lawsuit against The Law Society of BC after it refused to accredit a law school it wanted to open next year in Langley, British Columbia.

The BC Supreme Court judge hearing the case this week reserved judgment on Thursday.

The controversy turns on Trinity Western's "community covenant," under which students must abide by school's religious principles, including that "sexual intimacy is reserved for marriage between one man and one woman."

The Law Society of BC originally granted Trinity Western's law school accreditation, but then reversed course last October in an unusual referendum on the issue. More than 8,000 of the society's 13,530 lawyers voted against accrediting the program, which many perceive as discriminating against LGBTQ persons and flying in the face of the legal community's ethics. But the university contends that it is within its rights as a private institution to ask students to behave in accordance with school's religious values, and that the accreditation denial amounts to discriminating against people of faith.

"What's at stake for Trinity Western is the same thing that's at stake for any religious community in Canada: whether we are going to be denied full participation in public life in Canada," Earl Phillips, the executive director of Trinity Western's law school, told VICE News.

Phillips said that the sexual ethic in Trinity Western's covenant is the one that the school's religious community believes to be right, but emphasized that the university never inquiries into students' sexual orientations or activities. Agreeing to the covenant is part of the voluntary decision to attend the Christian university.

The Law Society of BC declined to comment, as the case is before the court. In its written argument to the court, the Society contends that by requiring students to abide by its covenant, Trinity Western is "not only limiting the access of LGBTQ and other persons to the legal profession, but also sending the message that the rights and freedoms of these persons are not deserving of protection and preservation in our legal system."

Victor Muniz-Fraticelli, a professor of law and political theory at McGill University who studies religious and institutional pluralism, told VICE News that he sees Trinity Western's covenant as discriminatory but nonetheless supports the accreditation of the school's law program on the grounds of religious freedom.

"If the claim is that every single law school, regardless of its religious affiliation, must teach the same curriculum, with the same values, in the same way, then you've basically said that there is no room for religious education in Canada," said Muniz-Fraticelli."It becomes a question of freedom of association and a question of the ability of Canadian legal institutions to admit that there is deep diversity in the provision of legal services and the provision of legal education."

These questions have been fueling debate throughout the country's legal community ever since Trinity Western first submitted its plan to open a law school three years ago.

In 2013, the Federation of Canadian Law Societies, which coordinates Canada's 14 bar associations, determined that the university's proposed program meets all academic and professional standards required for accreditation. However, the Federation's report also noted that the nebulous ethical issues raised by Trinity Western's covenant lie beyond its purview and that "the ultimate decision on [the program's] admissibility rests with the individual law societies."

The legal societies of Alberta, Saskatchewan, New Brunswick, Prince Edward Island, Newfoundland and Labrador, and Nunavut have offered Trinity Western accreditation. But those of Nova Scotia and Ontario decided not to accept graduates of the proposed law program, leading the university to mount similar court challenges.

In January, the Supreme Court of Nova Scotia ruled in favor of Trinity Western, finding that the provincial Barristers' Society did not have the authority to deny accreditation and, in attempting to do so, had failed to "reasonably consider the concerns for religious freedom and liberty of conscience." However, last month, Ontario's Divisional Court ruled against the university, upholding the Law Society of Upper Canada's 28-21 vote to deny accreditation and stating that Trinity Western's covenant would force LGBTQ persons wishing to attend "to essentially bury a crucial component of their very identity."

Trinity Western intends to appeal the Ontario court's decision, which a university spokesperson said in a statement, "points a knife at the freedom of faith communities across Canada to hold and practice their beliefs." The Barristers' Society will appeal the Nova Scotia ruling.

The fraught legal issue across multiple provinces and apparent intractability of the university and law societies means that regardless how the BC Supreme Court decides, the questions swirling around Trinity Western's proposed law school may only receive final answer from the Supreme Court of Canada.

In fact, the Supreme Court has already ruled on a very similar case involving Trinity Western. In 1995, the British Columbia College of Teachers denied the university accreditation for a teaching certification program on the grounds that its covenant — which then included language condemning homosexuality as a sin — would result in teachers discriminating against LGBTQ students. The school brought suit and in 2001 the court ruled that the covenant was an internal matter protected by the rights of a private association and that the College of Teachers had no authority to deny accreditation as the program met established professional requirements. It said there was no evidence graduates of Trinity Western treated homosexual students with prejudice.

While the legal battles play out, Trinity Western is without accreditation in British Columbia and has announced that it will not be opening its law school next year. Muniz-Fraticelli said that even if they are ultimately overruled, the decisions by legal associations to deny accreditation to Trinity Western will have broader social impact.

"It's important to also think of these lawsuits and these objections as the legal profession signaling where it is now on the issue of gay marriage, of signaling that it considers positions like Trinity Western's position to be beyond the realm of acceptability for lawyers," he said.